Problems encountered when using Total Segmentor for the first time - zenodo.org ... Failed to establish a new connection

Processing started
Writing input file to C:/Users/23398/AppData/Local/Temp/Slicer/__SlicerTemp__2023-08-16_15+49+58.272/total-segmentator-input.nii
Creating segmentations with TotalSegmentator AI…
Total Segmentator arguments: [‘-i’, ‘C:/Users/23398/AppData/Local/Temp/Slicer/__SlicerTemp__2023-08-16_15+49+58.272/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/23398/AppData/Local/Temp/Slicer/__SlicerTemp__2023-08-16_15+49+58.272/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]

If you use this tool please cite: [2208.05868] TotalSegmentator: robust segmentation of 104 anatomical structures in CT images

Using ‘fast’ option: resampling to lower resolution (3mm)
Downloading pretrained weights for Task 256 (~230MB) …
Traceback (most recent call last):
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\urllib3\connection.py”, line 174, in _new_conn
conn = connection.create_connection(
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\urllib3\util\connection.py”, line 72, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\socket.py”, line 954, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11004] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\urllib3\connectionpool.py”, line 703, in urlopen
httplib_response = self._make_request(
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\urllib3\connectionpool.py”, line 386, in _make_request
self._validate_conn(conn)
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\urllib3\connectionpool.py”, line 1042, in _validate_conn
conn.connect()
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\urllib3\connection.py”, line 358, in connect
self.sock = conn = self._new_conn()
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\urllib3\connection.py”, line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000024D31FC65E0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\requests\adapters.py”, line 489, in send
resp = conn.urlopen(
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\urllib3\connectionpool.py”, line 787, in urlopen
retries = retries.increment(
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\urllib3\util\retry.py”, line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘zenodo.org’, port=443): Max retries exceeded with url: /record/6802052/files/Task256_TotalSegmentator_3mm_1139subj.zip?download=1 (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x0000024D31FC65E0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed’))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Scripts\TotalSegmentator”, line 93, in
main()
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Scripts\TotalSegmentator”, line 86, in main
totalsegmentator(args.input, args.output, args.ml, args.nr_thr_resamp, args.nr_thr_saving,
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\totalsegmentator\python_api.py”, line 157, in totalsegmentator
download_pretrained_weights(task_id)
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\totalsegmentator\libs.py”, line 183, in download_pretrained_weights
download_url_and_unpack(WEIGHTS_URL, config_dir)
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\totalsegmentator\libs.py”, line 69, in download_url_and_unpack
raise e
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\totalsegmentator\libs.py”, line 55, in download_url_and_unpack
with requests.get(url, stream=True) as r:
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\requests\api.py”, line 73, in get
return request(“get”, url, params=params, **kwargs)
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\requests\api.py”, line 59, in request
return session.request(method=method, url=url, **kwargs)
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\requests\sessions.py”, line 587, in request
resp = self.send(prep, **send_kwargs)
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\requests\sessions.py”, line 701, in send
r = adapter.send(request, **kwargs)
File “E:\3D slicer\Slicer 5.2.2\lib\Python\Lib\site-packages\requests\adapters.py”, line 565, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘zenodo.org’, port=443): Max retries exceeded with url: /record/6802052/files/Task256_TotalSegmentator_3mm_1139subj.zip?download=1 (Caused by NewConnectionError(‘<urllib3.connection.HTTPSConnection object at 0x0000024D31FC65E0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed’))

It means that the server the model weights are downloaded from was overloaded. Most probably the download will succeed if you retry later (the downloaded data is cached, so once it is downloaded, you don’t need to worry about the server again) or you can try to manually download the model weights as described here.

On a second look, the Failed to establish a new connection indicates that the server was not accessible at all. This is more likely to be caused by a too aggressive firewall or proxy server.

If you cannot access zenodo.org in your web browser then you may need to connect via a VPN.

If you can access zenodo.org in your web browser then you may need to adjust your proxy settings. Slicer uses these system proxy settings by default, but you can set proxy server information in environment variables http_proxy and https_proxy.