I am also running into issue using manually installed weights. Using Mac 12.6.1 with slicer 5.4/5.5. Mac intel i5, intel iris 6100
I received the zip file from Jakob for bone_tissue_test. I had previously (i believe with slicer 5.4) installed total segmentator, and manually installed the weights by either using the import function, or copying into the 3d full res folder, I can’t recall now. It was workign great for awhile, selecting bones_tissue_test as the segmentation task in drop down menu.
At some point I installed slicer 5.5 and now I’ve run into issues. I downgraded to 5.4 and have the same issues. It basically error-ed and said I couldn’t select bones_tissue_test anymore. I then fooled around, trying to reinstall segmentator, reinstall pytorch, reinstall weights, and cannot get it to work anymore.
Here is the python log:
/Applications/Slicer.app/Contents/Extensions-31938/TotalSegmentator/lib/Slicer-5.4/qt-scripted-modules/TotalSegmentator.py:783: UserWarning: ‘has_cuda’ is deprecated, please use ‘torch.backends.cuda.is_built()’
cuda = torch.cuda if torch.has_cuda and torch.cuda.is_available() else None
[Python] Failed to compute results.
[Python] Command ‘[’/Applications/Slicer.app/Contents/bin/…/bin/PythonSlicer’, ‘/Applications/Slicer.app/Contents/lib/Python/bin/TotalSegmentator’, ‘-i’, ‘/private/var/folders/nv/5xxpc59s7rxbzpmwslgc90v00000gp/T/Slicer-allenm/__SlicerTemp__2023-10-11_19+15+50.643/total-segmentator-input.nii’, ‘-o’, ‘/private/var/folders/nv/5xxpc59s7rxbzpmwslgc90v00000gp/T/Slicer-allenm/__SlicerTemp__2023-10-11_19+15+50.643/segmentation’, ‘–ml’, ‘–task’, ‘bones_tissue_test’]’ returned non-zero exit status 2.
Traceback (most recent call last):
File “/Applications/Slicer.app/Contents/Extensions-31938/TotalSegmentator/lib/Slicer-5.4/qt-scripted-modules/TotalSegmentator.py”, line 271, in onApplyButton
self.logic.process(self.ui.inputVolumeSelector.currentNode(), self.ui.outputSegmentationSelector.currentNode(),
File “/Applications/Slicer.app/Contents/Extensions-31938/TotalSegmentator/lib/Slicer-5.4/qt-scripted-modules/TotalSegmentator.py”, line 868, in process
self.logProcessOutput(proc)
File “/Applications/Slicer.app/Contents/Extensions-31938/TotalSegmentator/lib/Slicer-5.4/qt-scripted-modules/TotalSegmentator.py”, line 701, in logProcessOutput
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command ‘[’/Applications/Slicer.app/Contents/bin/…/bin/PythonSlicer’, ‘/Applications/Slicer.app/Contents/lib/Python/bin/TotalSegmentator’, ‘-i’, ‘/private/var/folders/nv/5xxpc59s7rxbzpmwslgc90v00000gp/T/Slicer-allenm/__SlicerTemp__2023-10-11_19+15+50.643/total-segmentator-input.nii’, ‘-o’, ‘/private/var/folders/nv/5xxpc59s7rxbzpmwslgc90v00000gp/T/Slicer-allenm/__SlicerTemp__2023-10-11_19+15+50.643/segmentation’, ‘–ml’, ‘–task’, ‘bones_tissue_test’]’ returned non-zero exit status 2.
Inside the total segmentator window, this is the output:
Creating segmentations with TotalSegmentator AI…
Total Segmentator arguments: [‘-i’, ‘/private/var/folders/nv/5xxpc59s7rxbzpmwslgc90v00000gp/T/Slicer-allenm/__SlicerTemp__2023-10-11_19+15+50.643/total-segmentator-input.nii’, ‘-o’, ‘/private/var/folders/nv/5xxpc59s7rxbzpmwslgc90v00000gp/T/Slicer-allenm/__SlicerTemp__2023-10-11_19+15+50.643/segmentation’, ‘–ml’, ‘–task’, ‘bones_tissue_test’]
/Applications/Slicer.app/Contents/lib/Python/bin/TotalSegmentator:5: DeprecationWarning: pkg_resources is deprecated as an API. See Package Discovery and Resource Access using pkg_resources - setuptools 68.2.2.post20231008 documentation
from pkg_resources import require
usage: TotalSegmentator [-h] -i filepath -o directory [-ml]
[-nr NR_THR_RESAMP] [-ns NR_THR_SAVING] [-f]
[-t NORA_TAG] [-p]
[-ta {total,lung_vessels,cerebral_bleed,hip_implant,coronary_arteries,body,pleural_pericard_effusion,liver_vessels,bones_extremities,tissue_types,heartchambers_highres,head,aortic_branches,heartchambers_test,test}]
[-rs ROI_SUBSET [ROI_SUBSET …]] [-s] [-r]
[-cp CROP_PATH] [-bs] [-fs] [-q] [-v] [–test 0|1|2|3]
[–version]
TotalSegmentator: error: argument -ta/–task: invalid choice: ‘bones_tissue_test’ (choose from ‘total’, ‘lung_vessels’, ‘cerebral_bleed’, ‘hip_implant’, ‘coronary_arteries’, ‘body’, ‘pleural_pericard_effusion’, ‘liver_vessels’, ‘bones_extremities’, ‘tissue_types’, ‘heartchambers_highres’, ‘head’, ‘aortic_branches’, ‘heartchambers_test’, ‘test’)
Why is bones_tissue_test an invalid choice? In the totalsegmentator.py file it is listed in the self.tasks area?
Current pytorch util shows torch 2.1.0 and torchvision 0.16.0
Thanks for any help!