I am having the same issue with “returned non-zero exit status 120”
I have a clean install of Slicer 5.2.1. Am running with 128Gigs RAM and a 3090Ti with 24Gigs.
PyTorch is 1.13.1+cu117
I have noticed that the file that is saved in the …/fold_0 folder during processing is only called model_final_checkpoint.model - it does not have the .pkl extension as well - not sure if that is the issue?
TotalSegmentator window:
Processing started
Writing input file to C:/Users/282745H/AppData/Local/Temp/Slicer/__SlicerTemp__2023-01-03_17+18+42.605/total-segmentator-input.nii
Creating segmentations with TotalSegmentator AI…
Total Segmentator arguments: [‘-i’, ‘C:/Users/282745H/AppData/Local/Temp/Slicer/__SlicerTemp__2023-01-03_17+18+42.605/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/282745H/AppData/Local/Temp/Slicer/__SlicerTemp__2023-01-03_17+18+42.605/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]
Traceback (most recent call last):
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Scripts\TotalSegmentator”, line 201, in
main()
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Scripts\TotalSegmentator”, line 179, in main
seg = nnUNet_predict_image(args.input, args.output, task_id, model=model, folds=folds,
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py”, line 232, in nnUNet_predict_image
nnUNet_predict(tmp_dir, tmp_dir, task_id, model, folds, trainer, tta)
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py”, line 106, in nnUNet_predict
predict_from_folder(model_folder_name, dir_in, dir_out, folds, save_npz, num_threads_preprocessing,
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\inference\predict.py”, line 668, in predict_from_folder
return predict_cases_fastest(model, list_of_lists[part_id::num_parts], output_files[part_id::num_parts], folds,
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\inference\predict.py”, line 468, in predict_cases_fastest
trainer, params = load_model_and_checkpoint_files(model, folds, mixed_precision=mixed_precision, checkpoint_name=checkpoint_name)
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\training\model_restore.py”, line 140, in load_model_and_checkpoint_files
trainer = restore_model(join(folds[0], “%s.model.pkl” % checkpoint_name), fp16=mixed_precision)
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\training\model_restore.py”, line 56, in restore_model
info = load_pickle(pkl_file)
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\batchgenerators\utilities\file_and_folder_operations.py”, line 49, in load_pickle
with open(file, mode) as f:
FileNotFoundError: [Errno 2] No such file or directory: ‘C:\Users\282745H\.totalsegmentator\nnunet\results\nnUNet\3d_fullres\Task256_TotalSegmentator_3mm_1139subj\nnUNetTrainerV2_ep8000_nomirror__nnUNetPlansv2.1\fold_0\model_final_checkpoint.model.pkl’
Exception ignored in: <totalsegmentator.libs.DummyFile object at 0x000002BC5A99A730>
AttributeError: ‘DummyFile’ object has no attribute ‘flush’
Using ‘fast’ option: resampling to lower resolution (3mm)
Resampling…
Resampled in 0.88s
Predicting…
Small popup error window:
Traceback (most recent call last):
File “C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\bin\Python\slicer\util.py”, line 2961, in tryWithErrorDisplay
yield
File “C:/Users/282745H/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
self.logic.process(self.ui.inputVolumeSelector.currentNode(), self.ui.outputSegmentationSelector.currentNode(),
File “C:/Users/282745H/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
self.logProcessOutput(proc)
File “C:/Users/282745H/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
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command ‘[‘C:/Users/282745H/AppData/Local/NA-MIC/Slicer 5.2.1/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\282745H\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Scripts\TotalSegmentator’, ‘-i’, ‘C:/Users/282745H/AppData/Local/Temp/Slicer/__SlicerTemp__2023-01-03_17+18+42.605/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/282745H/AppData/Local/Temp/Slicer/__SlicerTemp__2023-01-03_17+18+42.605/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]’ returned non-zero exit status 120.