Not able to segment using TotalSegmentator

I tried every possible step I was able to find here, still it doesn’t work for me. This is what I receive:

Importing torch…
PyTorch 2.1.0+cpu imported successfully
CUDA available: False
Processing started
Writing input file to C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-07_16+05+03.035/total-segmentator-input.nii
Creating segmentations with TotalSegmentator AI…
Total Segmentator arguments: [‘-i’, ‘C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-07_16+05+03.035/total-segmentator-input.nii’, ‘-o’, 'C:/Users/jaros/AppData/Local/Temp/Slicer/_SlicerTemp__2023-11-07_16+05+03.035/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]
C:\Users\jaros\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 68.2.2.post20231016 documentation
from pkg_resources import require
C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.4.0\lib\Python\Lib\site-packages\requests_init
.py:102: RequestsDependencyWarning: urllib3 (1.26.18) or chardet (5.1.0)/charset_normalizer (2.0.12) doesn’t match a supported version!
warnings.warn("urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn’t match a supported "

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

No GPU detected. Running on CPU. This can be very slow. The ‘–fast’ option can help to some extend.
Using ‘fast’ option: resampling to lower resolution (3mm)
Using ‘fast’ option: resampling to lower resolution (3mm)
ERROR: Failed to compute results.

Command ‘[‘C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.4.0/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.4.0\lib\Python\Scripts\TotalSegmentator’, ‘-i’, ‘C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-07_16+05+03.035/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-07_16+05+03.035/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]’ returned non-zero exit status 1.
Traceback (most recent call last):
File “C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.4.0/slicer.org/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 “C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.4.0/slicer.org/Extensions-31938/TotalSegmentator/lib/Slicer-5.4/qt-scripted-modules/TotalSegmentator.py”, line 781, in process
self.logProcessOutput(proc)
File “C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.4.0/slicer.org/Extensions-31938/TotalSegmentator/lib/Slicer-5.4/qt-scripted-modules/TotalSegmentator.py”, line 614, in logProcessOutput
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command ‘[‘C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.4.0/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.4.0\lib\Python\Scripts\TotalSegmentator’, ‘-i’, ‘C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-07_16+05+03.035/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-07_16+05+03.035/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]’ returned non-zero exit status 1.

Thanks for help.

It appears you don’t have CUDA installed. Please try to solve that then try to use the TotalSegmentator module again

Hope it helps

What are your system specifications ? Do you have a GPU installed ? Which brand and model ?

Dear Maoro, Rudolf,

in fact I didn’t want to use GPU on purpose for it doesn’t have enough RAM. So I wanted to force use CPU. The segmentation works on my desktop, but is rather slow since it’s an office computer. I’d like to run TotalSegmentator on laptop:

  • HP Victus
  • AMD Ryzen7 5800H with Radeon Graphics / 16GB RAM
  • Windows 11
  • Nvidia GeForce RTX 3060 Laptop GPU (6GB RAM)

I had no luck. In this case I’m just a normal user, so the installation became too difficult. I updated the whole system including all drivers.

Thank you for any advice.

C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.4.0\lib\Python\Lib\site-packages\requests_init* .py:102: RequestsDependencyWarning: urllib3 (1.26.18) or chardet (5.1.0)/charset_normalizer (2.0.12) doesn’t match a supported version!

This is the root cause of the error. Package installation fails because some unnecessary requirements specified by nnunet. Probably you have tried to install previous versions of TotalSegmentator in this Slicer installation tree or the Python environment was messed up by some other extensions.

You can fix the issue by uninstalling Slicer and completely wiping off the content of the C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.4.0 folder and then installing Slicer again.

I would recommend to install the latest Slicer Preview Release (currently Slicer-5.5), as it installs the new TotalSegmentator version that can segment more structures and has a couple of other improvements.

Yes, and install Pytorch via the extension, in CPU mode

Hi ,

After the new Updation for Total Segmentator I am also facing similar issues. Even if I change the classes for total or any other.

Can anyone help me this?

Thanks & Regards,
Linda

Dear Rudolf and Andras,

I wiped all files repeatedly before and nothing worked. I did again, used the Preview version and installed Pytorch CPU. At first it looked good, it even started to download data (weights?) but than it failed again. The next tries are even worse.

As far as I can see from the log, there’s a memory issue. But this machine has 16GB RAM, and the problem is with allocating 1.14GB?

[DEBUG][Qt] 09.11.2023 14:48:38 (unknown:0) - Session start time …: 2023-11-09 14:48:38
[DEBUG][Qt] 09.11.2023 14:48:38 (unknown:0) - Slicer version …: 5.5.0-2023-11-07 (revision 32301 / 17d23da) win-amd64 - installed release
[DEBUG][Qt] 09.11.2023 14:48:38 (unknown:0) - Operating system …: Windows / Personal / (Build 22631, Code Page 65001) - 64-bit
[DEBUG][Qt] 09.11.2023 14:48:38 (unknown:0) - Memory …: 15713 MB physical, 16225 MB virtual
[DEBUG][Qt] 09.11.2023 14:48:38 (unknown:0) - CPU …: AuthenticAMD AMD Ryzen 7 5800H with Radeon Graphics , 16 cores, 16 logical processors
[DEBUG][Qt] 09.11.2023 14:48:38 (unknown:0) - VTK configuration …: OpenGL2 rendering, TBB threading
[DEBUG][Qt] 09.11.2023 14:48:38 (unknown:0) - Qt configuration …: version 5.15.2, with SSL, requested OpenGL 3.2 (compatibility profile)
[DEBUG][Qt] 09.11.2023 14:48:38 (unknown:0) - Internationalization …: disabled, language=
[DEBUG][Qt] 09.11.2023 14:48:38 (unknown:0) - Developer mode …: disabled
[DEBUG][Qt] 09.11.2023 14:48:38 (unknown:0) - Application path …: C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/bin
[DEBUG][Qt] 09.11.2023 14:48:38 (unknown:0) - Additional module paths …: slicer.org/Extensions-32301/PyTorch/lib/Slicer-5.5/qt-scripted-modules, slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules
[DEBUG][Python] 09.11.2023 14:48:43 [Python] (C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Slicer-5.5\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: SegmentEditor
[DEBUG][Python] 09.11.2023 14:48:43 [Python] (C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Slicer-5.5\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: SegmentStatistics
[DEBUG][Qt] 09.11.2023 14:48:43 (unknown:0) - Switch to module: “Welcome”
[INFO][Stream] 09.11.2023 14:48:44 (unknown:0) - Loading Slicer RC file [C:/Users/jaros/.slicerrc.py]
[DEBUG][Qt] 09.11.2023 14:48:48 (unknown:0) - Switch to module: “DICOM”
[INFO][Python] 09.11.2023 14:48:54 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/bin/…/lib/Slicer-5.5/qt-scripted-modules/DICOMScalarVolumePlugin.py:400) - Loading with imageIOName: GDCM
[INFO][Python] 09.11.2023 14:48:55 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/bin/…/lib/Slicer-5.5/qt-scripted-modules/DICOMScalarVolumePlugin.py:479) - Window/level found in DICOM tags (center=40.0, width=400.0) has been applied to volume 2: Planovani Hrudnik MULAZ POD PRSEM 1,00 Qr40 S3
[DEBUG][Qt] 09.11.2023 14:49:00 (unknown:0) - Switch to module: “TotalSegmentator”
[INFO][Stream] 09.11.2023 14:49:04 (unknown:0) - WARNING: Ignoring invalid distribution -illow (c:\users\jaros\appdata\local\slicer.org\slicer 5.5.0-2023-11-07\lib\python\lib\site-packages)
[INFO][Stream] 09.11.2023 14:49:04 (unknown:0) - Requirement already satisfied: pillow<10.1 in c:\users\jaros\appdata\local\slicer.org\slicer 5.5.0-2023-11-07\lib\python\lib\site-packages (10.0.1)
[INFO][Stream] 09.11.2023 14:49:05 (unknown:0) - WARNING: Ignoring invalid distribution -illow (c:\users\jaros\appdata\local\slicer.org\slicer 5.5.0-2023-11-07\lib\python\lib\site-packages)
[INFO][Stream] 09.11.2023 14:49:05 (unknown:0) - WARNING: There was an error checking the latest version of pip.
[INFO][Python] 09.11.2023 14:49:08 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/PyTorch/lib/Slicer-5.5/qt-scripted-modules/PyTorchUtils.py:153) - Importing torch…
[INFO][Python] 09.11.2023 14:49:08 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/PyTorch/lib/Slicer-5.5/qt-scripted-modules/PyTorchUtils.py:190) - PyTorch 2.1.0+cpu imported successfully
[INFO][Python] 09.11.2023 14:49:08 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/PyTorch/lib/Slicer-5.5/qt-scripted-modules/PyTorchUtils.py:191) - CUDA available: False
[INFO][Python] 09.11.2023 14:49:08 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - Processing started
[CRITICAL][Stream] 09.11.2023 14:49:08 (unknown:0) - C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:880: UserWarning: ‘has_cuda’ is deprecated, please use ‘torch.backends.cuda.is_built()’
[CRITICAL][Stream] 09.11.2023 14:49:08 (unknown:0) - cuda = torch.cuda if torch.has_cuda and torch.cuda.is_available() else None
[INFO][Python] 09.11.2023 14:49:10 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - Writing input file to C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-09_14+49+08.273/total-segmentator-input.nii
[INFO][Python] 09.11.2023 14:49:10 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - Creating segmentations with TotalSegmentator AI…
[INFO][Python] 09.11.2023 14:49:10 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - Total Segmentator arguments: [‘-i’, ‘C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-09_14+49+08.273/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-09_14+49+08.273/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - multiprocessing.pool.RemoteTraceback:
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - “”"
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - Traceback (most recent call last):
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\multiprocessing\pool.py”, line 125, in worker
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - result = (True, func(*args, **kwds))
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\multiprocessing\pool.py”, line 51, in starmapstar
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - return list(itertools.starmap(args[0], args[1]))
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\site-packages\nnunetv2\inference\export_prediction.py”, line 39, in export_prediction_from_softmax
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - segmentation = label_manager.convert_logits_to_segmentation(predicted_array_or_file)
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\site-packages\nnunetv2\utilities\label_handling\label_handling.py”, line 182, in convert_logits_to_segmentation
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - return self.convert_probabilities_to_segmentation(probabilities)
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\site-packages\nnunetv2\utilities\label_handling\label_handling.py”, line 175, in convert_probabilities_to_segmentation
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - segmentation = predicted_probabilities.argmax(0)
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - numpy.core._exceptions._ArrayMemoryError: Unable to allocate 1.14 GiB for an array with shape (65, 200, 200, 118) and data type float32
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - “”"
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) -
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - The above exception was the direct cause of the following exception:
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) -
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - Traceback (most recent call last):
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\runpy.py”, line 197, in _run_module_as_main
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - return _run_code(code, main_globals, None,
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\runpy.py”, line 87, in run_code
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - exec(code, run_globals)
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File "C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Scripts\TotalSegmentator.exe_main
.py", line 7, in
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\site-packages\totalsegmentator\bin\TotalSegmentator.py”, line 127, in main
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - totalsegmentator(args.input, args.output, args.ml, args.nr_thr_resamp, args.nr_thr_saving,
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\site-packages\totalsegmentator\python_api.py”, line 293, in totalsegmentator
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - seg_img, ct_img = nnUNet_predict_image(input, output, task_id, model=model, folds=folds,
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py”, line 395, in nnUNet_predict_image
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - nnUNetv2_predict(tmp_dir, tmp_dir, task_id, model, folds, trainer, tta,
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py”, line 178, in nnUNetv2_predict
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - predict_from_raw_data(dir_in,
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\site-packages\nnunetv2\inference\predict_from_raw_data.py”, line 347, in predict_from_raw_data
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - [i.get() for i in r]
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\site-packages\nnunetv2\inference\predict_from_raw_data.py”, line 347, in
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - [i.get() for i in r]
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Lib\multiprocessing\pool.py”, line 771, in get
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - raise self._value
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - numpy.core._exceptions._ArrayMemoryError: Unable to allocate 1.14 GiB for an array with shape (65, 200, 200, 118) and data type float32
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - Exception ignored in: <totalsegmentator.libs.DummyFile object at 0x00000239DBB96040>
[INFO][Python] 09.11.2023 14:50:15 [Python] (C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py:544) - AttributeError: ‘DummyFile’ object has no attribute ‘flush’
[ERROR][Python] 09.11.2023 14:50:16 [Python] (C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\bin\Python\slicer\util.py:2909) - Failed to compute results.

Command ‘[‘C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Scripts\TotalSegmentator.exe’, ‘-i’, ‘C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-09_14+49+08.273/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-09_14+49+08.273/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]’ returned non-zero exit status 120.
[CRITICAL][Stream] 09.11.2023 14:50:28 (unknown:0) - Traceback (most recent call last):
[CRITICAL][Stream] 09.11.2023 14:50:28 (unknown:0) - File “C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py”, line 292, in onApplyButton
[CRITICAL][Stream] 09.11.2023 14:50:28 (unknown:0) - self.logic.process(self.ui.inputVolumeSelector.currentNode(), self.ui.outputSegmentationSelector.currentNode(),
[CRITICAL][Stream] 09.11.2023 14:50:28 (unknown:0) - File “C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py”, line 967, in process
[CRITICAL][Stream] 09.11.2023 14:50:28 (unknown:0) - self.logProcessOutput(proc)
[CRITICAL][Stream] 09.11.2023 14:50:28 (unknown:0) - File “C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py”, line 787, in logProcessOutput
[CRITICAL][Stream] 09.11.2023 14:50:28 (unknown:0) - raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
[CRITICAL][Stream] 09.11.2023 14:50:28 (unknown:0) - subprocess.CalledProcessError: Command ‘[‘C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Python\Scripts\TotalSegmentator.exe’, ‘-i’, ‘C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-09_14+49+08.273/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/jaros/AppData/Local/Temp/Slicer/__SlicerTemp__2023-11-09_14+49+08.273/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]’ returned non-zero exit status 120.

Do you have any ideas what could be the issue?

Thank you.

Invest in better hardware with a decent GPU (NVIDIA, 24GB GPU memory)
Good look

Dear Rudolf,

will probably do. On the other hand, TotalSegmenter runs smoothly on my desktop:

  • Intel i5-9600
  • 8GB RAM + Intel graphics (no GPU)
  • Win11

Thus I guess the problem is also somewhere else.

Couldn’t the problem be caused by:

[DEBUG][Qt] 10.11.2023 14:51:02 (unknown:0) - Session start time …: 2023-11-10 14:51:02
[DEBUG][Qt] 10.11.2023 14:51:02 (unknown:0) - Slicer version …: 5.5.0-2023-11-07 (revision 32301 / 17d23da) win-amd64 - installed release
[DEBUG][Qt] 10.11.2023 14:51:02 (unknown:0) - Operating system …: Windows / Personal / (Build 22631, Code Page 65001) - 64-bit
[DEBUG][Qt] 10.11.2023 14:51:02 (unknown:0) - Memory …: 15713 MB physical, 16225 MB virtual
[DEBUG][Qt] 10.11.2023 14:51:02 (unknown:0) - CPU …: AuthenticAMD AMD Ryzen 7 5800H with Radeon Graphics , 16 cores, 16 logical processors
[DEBUG][Qt] 10.11.2023 14:51:02 (unknown:0) - VTK configuration …: OpenGL2 rendering, TBB threading
[DEBUG][Qt] 10.11.2023 14:51:02 (unknown:0) - Qt configuration …: version 5.15.2, with SSL, requested OpenGL 3.2 (compatibility profile)
[DEBUG][Qt] 10.11.2023 14:51:02 (unknown:0) - Internationalization …: disabled, language=
[DEBUG][Qt] 10.11.2023 14:51:02 (unknown:0) - Developer mode …: disabled
[DEBUG][Qt] 10.11.2023 14:51:02 (unknown:0) - Application path …: C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/bin
[DEBUG][Qt] 10.11.2023 14:51:02 (unknown:0) - Additional module paths …: slicer.org/Extensions-32301/PyTorch/lib/Slicer-5.5/qt-scripted-modules, slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules
[DEBUG][Python] 10.11.2023 14:51:05 [Python] (C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Slicer-5.5\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: SegmentEditor
[DEBUG][Python] 10.11.2023 14:51:05 [Python] (C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\lib\Slicer-5.5\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:38) - Scripted subject hierarchy plugin registered: SegmentStatistics
[DEBUG][Qt] 10.11.2023 14:51:05 (unknown:0) - Switch to module: “Welcome”
[INFO][Stream] 10.11.2023 14:51:06 (unknown:0) - Loading Slicer RC file [C:/Users/jaros/.slicerrc.py]
[DEBUG][Qt] 10.11.2023 14:51:21 (unknown:0) - Switch to module: “TotalSegmentator”
[INFO][Stream] 10.11.2023 14:51:28 (unknown:0) - Collecting pandas
[INFO][Stream] 10.11.2023 14:51:28 (unknown:0) - Obtaining dependency information for pandas from https://files.pythonhosted.org/packages/3f/7a/8ecafdb6a6990ad90f0366a8d7356e9d62118ce832c38ca4fe6136a5e207/pandas-2.1.2-cp39-cp39-win_amd64.whl.metadata
[INFO][Stream] 10.11.2023 14:51:28 (unknown:0) - Using cached pandas-2.1.2-cp39-cp39-win_amd64.whl.metadata (18 kB)
[INFO][Stream] 10.11.2023 14:51:28 (unknown:0) - Requirement already satisfied: numpy<2,>=1.22.4 in c:\users\jaros\appdata\local\slicer.org\slicer 5.5.0-2023-11-07\lib\python\lib\site-packages (from pandas) (1.26.1)
[INFO][Stream] 10.11.2023 14:51:28 (unknown:0) - Requirement already satisfied: python-dateutil>=2.8.2 in c:\users\jaros\appdata\local\slicer.org\slicer 5.5.0-2023-11-07\lib\python\lib\site-packages (from pandas) (2.8.2)
[INFO][Stream] 10.11.2023 14:51:29 (unknown:0) - Collecting pytz>=2020.1 (from pandas)
[INFO][Stream] 10.11.2023 14:51:29 (unknown:0) - Obtaining dependency information for pytz>=2020.1 from https://files.pythonhosted.org/packages/32/4d/aaf7eff5deb402fd9a24a1449a8119f00d74ae9c2efa79f8ef9994261fc2/pytz-2023.3.post1-py2.py3-none-any.whl.metadata
[INFO][Stream] 10.11.2023 14:51:29 (unknown:0) - Using cached pytz-2023.3.post1-py2.py3-none-any.whl.metadata (22 kB)
[INFO][Stream] 10.11.2023 14:51:29 (unknown:0) - Collecting tzdata>=2022.1 (from pandas)
[INFO][Stream] 10.11.2023 14:51:29 (unknown:0) - Using cached tzdata-2023.3-py2.py3-none-any.whl (341 kB)
[INFO][Stream] 10.11.2023 14:51:29 (unknown:0) - Requirement already satisfied: six>=1.5 in c:\users\jaros\appdata\local\slicer.org\slicer 5.5.0-2023-11-07\lib\python\lib\site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)
[INFO][Stream] 10.11.2023 14:51:29 (unknown:0) - Using cached pandas-2.1.2-cp39-cp39-win_amd64.whl (10.8 MB)
[INFO][Stream] 10.11.2023 14:51:29 (unknown:0) - Using cached pytz-2023.3.post1-py2.py3-none-any.whl (502 kB)
[INFO][Stream] 10.11.2023 14:51:29 (unknown:0) - Installing collected packages: pytz, tzdata, pandas
[INFO][Stream] 10.11.2023 14:51:38 (unknown:0) - Successfully installed pandas-2.1.2 pytz-2023.3.post1 tzdata-2023.3
[INFO][Stream] 10.11.2023 14:51:38 (unknown:0) - WARNING: There was an error checking the latest version of pip.
[INFO][Stream] 10.11.2023 14:51:39 (unknown:0) - Collecting pillow<10.1
[INFO][Stream] 10.11.2023 14:51:39 (unknown:0) - Obtaining dependency information for pillow<10.1 from https://files.pythonhosted.org/packages/a8/fd/ce5fab4a15f4e38c5f6b86377f2c2ef6c92ec9a48e7296048251057a58ec/Pillow-10.0.1-cp39-cp39-win_amd64.whl.metadata
[INFO][Stream] 10.11.2023 14:51:39 (unknown:0) - Using cached Pillow-10.0.1-cp39-cp39-win_amd64.whl.metadata (9.6 kB)
[INFO][Stream] 10.11.2023 14:51:39 (unknown:0) - Using cached Pillow-10.0.1-cp39-cp39-win_amd64.whl (2.5 MB)
[INFO][Stream] 10.11.2023 14:51:39 (unknown:0) - Installing collected packages: pillow
[INFO][Stream] 10.11.2023 14:51:39 (unknown:0) - Attempting uninstall: pillow
[INFO][Stream] 10.11.2023 14:51:39 (unknown:0) - Found existing installation: Pillow 10.1.0
[INFO][Stream] 10.11.2023 14:51:39 (unknown:0) - Uninstalling Pillow-10.1.0:
[INFO][Stream] 10.11.2023 14:51:39 (unknown:0) - Successfully uninstalled Pillow-10.1.0
[INFO][Stream] 10.11.2023 14:51:43 (unknown:0) -
[INFO][Stream] 10.11.2023 14:51:43 (unknown:0) - WARNING: There was an error checking the latest version of pip.
[ERROR][Python] 10.11.2023 14:51:43 [Python] (C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\bin\Python\slicer\util.py:2909) - Failed to upgrade TotalSegmentator

Command ‘[‘C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/bin/…/bin\PythonSlicer.EXE’, ‘-m’, ‘pip’, ‘install’, ‘pillow<10.1’]’ returned non-zero exit status 1.
[CRITICAL][Stream] 10.11.2023 14:54:33 (unknown:0) - Traceback (most recent call last):
[CRITICAL][Stream] 10.11.2023 14:54:33 (unknown:0) - File “C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py”, line 304, in onPackageUpgrade
[CRITICAL][Stream] 10.11.2023 14:54:33 (unknown:0) - self.logic.setupPythonRequirements(upgrade=True)
[CRITICAL][Stream] 10.11.2023 14:54:33 (unknown:0) - File “C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/slicer.org/Extensions-32301/TotalSegmentator/lib/Slicer-5.5/qt-scripted-modules/TotalSegmentator.py”, line 680, in setupPythonRequirements
[CRITICAL][Stream] 10.11.2023 14:54:33 (unknown:0) - slicer.util.pip_install(“pillow<10.1”)
[CRITICAL][Stream] 10.11.2023 14:54:33 (unknown:0) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\bin\Python\slicer\util.py”, line 3759, in pip_install
[CRITICAL][Stream] 10.11.2023 14:54:33 (unknown:0) - _executePythonModule(“pip”, args)
[CRITICAL][Stream] 10.11.2023 14:54:33 (unknown:0) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\bin\Python\slicer\util.py”, line 3721, in _executePythonModule
[CRITICAL][Stream] 10.11.2023 14:54:33 (unknown:0) - logProcessOutput(proc)
[CRITICAL][Stream] 10.11.2023 14:54:33 (unknown:0) - File “C:\Users\jaros\AppData\Local\slicer.org\Slicer 5.5.0-2023-11-07\bin\Python\slicer\util.py”, line 3690, in logProcessOutput
[CRITICAL][Stream] 10.11.2023 14:54:33 (unknown:0) - raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
[CRITICAL][Stream] 10.11.2023 14:54:33 (unknown:0) - subprocess.CalledProcessError: Command ‘[‘C:/Users/jaros/AppData/Local/slicer.org/Slicer 5.5.0-2023-11-07/bin/…/bin\PythonSlicer.EXE’, ‘-m’, ‘pip’, ‘install’, ‘pillow<10.1’]’ returned non-zero exit status 1.

There seems to be some problem with Pillow installation, but I’m not able to solve that.