TotalSegmentator failed to compute results - file not found

Hello, Lassoan.
Firstly, thank you for sharing this awesome extension, SlicerTotalSegmentator

During using this(actually for first time), I faced an error issue
Could you give me any advice about that?

for information, my GPU is GeForce RTX 3090 Ti which has 24GB

Please try the CTChest sample dataset. Is there still an error message?

@3omeoneS

Could you please check if you can find more specific error messages in the textbox below the Apply button after clicking OK on the popup?
You can also look for more details in the application log that you can get in menu: Help / Report a bug.

well… what is difference between my sample and CT chest sample?
I think they are same actually. :sob:

well… I posted bug log… but the system made it hidden;;
they thought it was spam -_-;;

TotalSegmentator.py:452) - FileNotFoundError: [Errno 2] No such file or directory: ‘C:\Users\computer\.totalsegmentator\nnunet\results\nnUNet\3d_fullres\Task253_TotalSegmentator_part3_cardiac_1139subj\nnUNetTrainerV2_ep4000_nomirror__nnUNetPlansv2.1\plans.pkl’
TotalSegmentator.py:452) - Exception ignored in: <totalsegmentator.libs.DummyFile object at 0x0000024A418D96A0>
TotalSegmentator.py:452) - AttributeError: ‘DummyFile’ object has no attribute ‘flush’

A post was split to a new topic: TotalSegmentator fails with error 120

This is very useful information. It means that the first time you have run TotalSegmentator the model download was incomplete (either network transient network problem or you were not patient enough and interrupted).

You can fix this by deleting the C:\Users\computer\.totalsegmentator folder and restart. Normally model download completes within a couple of minutes, but just in case, give it an hour.

Sorry to late reply

well… the log file can’t be uploaded;;
so I look into log and here is the point where the bug was started

--------------------------------------------------------------------------------
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) -   File "C:\Users\@@@@\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\shutil.py", line 264, in copyfile
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) -     with open(src, 'rb') as fsrc:
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) - FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\@@@@\\.totalsegmentator\\nnunet\\results\\nnUNet\\3d_fullres\\Task253_TotalSegmentator_part3_cardiac_1139subj\\nnUNetTrainerV2_ep4000_nomirror__nnUNetPlansv2.1\\plans.pkl'
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) - Exception ignored in: <totalsegmentator.libs.DummyFile object at 0x0000024A418D96A0>
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) - AttributeError: 'DummyFile' object has no attribute 'flush'
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) - Downloading pretrained weights for Task 254 (~230MB) ...
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) - Download finished. Extracting...
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) -   downloaded in 65.10s
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) - Downloading pretrained weights for Task 255 (~230MB) ...
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) - Download finished. Extracting...
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) -   downloaded in 59.25s
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) - Resampling...
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) -   Resampled in 6.94s
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) - Predicting part 0 of 5 ...
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) - Predicting part 1 of 5 ...
[INFO][Python] 09.01.2023 08:56:07 [Python] (C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py:452) - Predicting part 2 of 5 ...
[ERROR][Python] 09.01.2023 08:56:08 [Python] (C:\Users\@@@@\AppData\Local\NA-MIC\Slicer 5.2.1\bin\Python\slicer\util.py:2730) - Failed to compute results.

Command '['C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/bin/../bin\\PythonSlicer.EXE', 'C:\\Users\\@@@@\\AppData\\Local\\NA-MIC\\Slicer 5.2.1\\lib\\Python\\Scripts\\TotalSegmentator', '-i', 'C:/Users/@@@@/AppData/Local/Temp/Slicer/__SlicerTemp__2023-01-09_08+53+26.103/total-segmentator-input.nii', '-o', 'C:/Users/@@@@/AppData/Local/Temp/Slicer/__SlicerTemp__2023-01-09_08+53+26.103/segmentation', '--ml', '--task', 'total']' returned non-zero exit status 120.
[CRITICAL][Stream] 09.01.2023 08:56:44 [] (unknown:0) - Traceback (most recent call last):
[CRITICAL][Stream] 09.01.2023 08:56:44 [] (unknown:0) -   File "C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py", line 258, in onApplyButton
[CRITICAL][Stream] 09.01.2023 08:56:44 [] (unknown:0) -     self.logic.process(self.ui.inputVolumeSelector.currentNode(), self.ui.outputSegmentationSelector.currentNode(),
[CRITICAL][Stream] 09.01.2023 08:56:44 [] (unknown:0) -   File "C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py", line 715, in process
[CRITICAL][Stream] 09.01.2023 08:56:44 [] (unknown:0) -     self.logProcessOutput(proc)
[CRITICAL][Stream] 09.01.2023 08:56:44 [] (unknown:0) -   File "C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py", line 624, in logProcessOutput
[CRITICAL][Stream] 09.01.2023 08:56:44 [] (unknown:0) -     raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
[CRITICAL][Stream] 09.01.2023 08:56:44 [] (unknown:0) - subprocess.CalledProcessError: Command '['C:/Users/@@@@/AppData/Local/NA-MIC/Slicer 5.2.1/bin/../bin\\PythonSlicer.EXE', 'C:\\Users\\@@@@\\AppData\\Local\\NA-MIC\\Slicer 5.2.1\\lib\\Python\\Scripts\\TotalSegmentator', '-i', 'C:/Users/@@@@/AppData/Local/Temp/Slicer/__SlicerTemp__2023-01-09_08+53+26.103/total-segmentator-input.nii', '-o', 'C:/Users/@@@@/AppData/Local/Temp/Slicer/__SlicerTemp__2023-01-09_08+53+26.103/segmentation', '--ml', '--task', 'total']' returned non-zero exit status 120.
--------------------------------------------------------------------------------

cf) I changed my computer's domain name to '@@@@'

File uploads should be kept at minimum to keep hosting costs under control. You can upload any files anywhere (your dropbox, onedrive, google drive, etc.) and just post the link here.

WOW AMAZING! It worked!!!

I think, the problem was GPU issue.
When I uses this for first time, my computer GPU status was running on other works(deep learning stuff).
And for following your adivce, I cleaned whole GPU cash, and delete TotalSegmentator and restart → finally It worked.

Thank you.

1 Like

I got the same error:

Here is log message popped up by TotalSegmentator:

Processing started
Writing input file to C:/Users/username/AppData/Local/Temp/Slicer/__SlicerTemp__2023-10-17_17+57+36.230/total-segmentator-input.nii
Creating segmentations with TotalSegmentator AI…
Total Segmentator arguments: [‘-i’, ‘C:/Users/username/AppData/Local/Temp/Slicer/__SlicerTemp__2023-10-17_17+57+36.230/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/username/AppData/Local/Temp/Slicer/__SlicerTemp__2023-10-17_17+57+36.230/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]
C:\Users\username\AppData\Local\slicer.org\Slicer 5.4.0\lib\Python\Scripts\TotalSegmentator:5: DeprecationWarning: pkg_resources is deprecated as an API. See Package Discovery and Resource Access using pkg_resources - setuptools 69.0.2.post20231121 documentation
from pkg_resources import require

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 “C:\Users\username\AppData\Local\slicer.org\Slicer 5.4.0\lib\Python\Scripts\TotalSegmentator”, line 93, in
main()
File “C:\Users\username\AppData\Local\slicer.org\Slicer 5.4.0\lib\Python\Scripts\TotalSegmentator”, line 86, in main
totalsegmentator(args.input, args.output, args.ml, args.nr_thr_resamp, args.nr_thr_saving,
File “C:\Users\username\AppData\Local\slicer.org\Slicer 5.4.0\lib\Python\Lib\site-packages\totalsegmentator\python_api.py”, line 157, in totalsegmentator
download_pretrained_weights(task_id)
File “C:\Users\username\AppData\Local\slicer.org\Slicer 5.4.0\lib\Python\Lib\site-packages\totalsegmentator\libs.py”, line 183, in download_pretrained_weights
download_url_and_unpack(WEIGHTS_URL, config_dir)
File “C:\Users\username\AppData\Local\slicer.org\Slicer 5.4.0\lib\Python\Lib\site-packages\totalsegmentator\libs.py”, line 69, in download_url_and_unpack
raise e
File “C:\Users\username\AppData\Local\slicer.org\Slicer 5.4.0\lib\Python\Lib\site-packages\totalsegmentator\libs.py”, line 56, in download_url_and_unpack
r.raise_for_status()
File “C:\Users\username\AppData\Local\slicer.org\Slicer 5.4.0\lib\Python\Lib\site-packages\requests\models.py”, line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://zenodo.org/record/6802052/files/Task256_TotalSegmentator_3mm_1139subj.zip?download=1

Blockquote

Whether use fast mode or not, the error is the same.

It prompted me that my GPU mem is less than 7GB. I clicked yes.
image

The second time, I clicked no, but the error was the same.

By the way, do I need to install CUDA myself to use GPU? I’m working on Win 10.

By the way, I have deleted the folder. TotalSegmentator and restarted.

The data is from the sample ‘CTchest’.

If you have Docker and git installed on your system, you can try MRunner extension: GitHub - MHubAI/SlicerMRunner: Beta Version. Browse and run all mhub models directly within 3D Slicer.. It also has TotalSegmentator, packaged using different means.

fyi @denbonte

1 Like

We are having problems with the Zenodo servers currently so users run into problems when they want to use TotalSegmentator from the extension. We will push an update and switch to TS version 1.5.7 where weights get loaded from GitHub.You would need to install the update when available and force install TotalSegmentator once.

image

The displayed package information should be 1.5.7

Thanks for the information. Looking forward to the update.

@rbumm : Do you have an estimate when this will be ready? I see that SlicerTotalSegmentator has been updated to use totalsegmentator 1.5.7.

MRunner extension mentioned in TotalSegmentator failed to compute results - file not found - #15 by fedorov has weights packaged within the docker container, so it should work independently of the regression in the TotalSegmentator release.

1 Like

MRunner can be great option if you have docker.

We have fixed TotalSegmentator extension (using 1.5.7). Install latest Slicer Stable Release and update or reinstall TotalSegmentator extension. Or inatall latest Slicer Preview Release and install TotalSegmentator extension.

We will release a new version of TotalSegmentator Slicer extension next week that works with TotalSegmentator 2.0.5, which brings imepoved accuracy and new segments.