# TotalSegmentator error at first run: Command ...Python\\Scripts\\TotalSegmentator... returned non-zero exit status 120

**URL:** <https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [December 15, 2022, 2:41pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755 "2022-12-15T14:41:15Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Augusto](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/augusto/32/17710_2.png) [@Augusto](https://discourse.slicer.org/u/Augusto)\
**Post date:** [December 15, 2022, 9:18pm UTC](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755/7 "2022-12-15T21:18:54Z")

</div>

For the time being, since i have slicer installed in a computer which, by default, has no internet acess, i cannot download the sample data set and test TotalSegmentator with it. As soon as i have acess to internet, i will try.

The messages that appear after the Apply button are as follows:

Processing started  
Writing input file to C:/Users/Augusto/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2022-12-15\_21+10+39.789/total-segmentator-input.nii  
Creating segmentations with TotalSegmentator AI…  
Total Segmentator arguments: [‘-i’, ‘C:/Users/Augusto/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2022-12-15\_21+10+39.789/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/Augusto/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2022-12-15\_21+10+39.789/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]

If you have questions or suggestions, feel free to open an issue at [GitHub - MIC-DKFZ/nnUNet](https://github.com/MIC-DKFZ/nnUNet)  
preprocessing C:\Users\Augusto\AppData\Local\Temp\nnunet\_tmp\_kqifjdkf\s01.nii.gz  
before crop: (1, 228, 171, 171) after crop: (1, 228, 171, 171) spacing: [3. 3. 3.]  
no resampling necessary  
before: {‘spacing’: array([3., 3., 3.]), ‘spacing\_transposed’: array([3., 3., 3.]), ‘data.shape (data is transposed)’: (1, 228, 171, 171)}

This worker has ended successfully, no errors to report  
File “C:\Users\Augusto\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Scripts\TotalSegmentator”, line 201, in   
File “C:\Users\Augusto\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Scripts\TotalSegmentator”, line 179, in main  
File “C:\Users\Augusto\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py”, line 232, in nnUNet\_predict\_image  
File “C:\Users\Augusto\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py”, line 106, in nnUNet\_predict  
File “C:\Users\Augusto\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\inference\predict.py”, line 668, in predict\_from\_folder  
File “C:\Users\Augusto\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\inference\predict.py”, line 493, in predict\_cases\_fastest  
File “C:\Users\Augusto\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\training\network\_training\nnUNetTrainerV2.py”, line 211, in predict\_preprocessed\_data\_return\_seg\_and\_softmax  
File “C:\Users\Augusto\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\training\network\_training\nnUNetTrainer.py”, line 516, in predict\_preprocessed\_data\_return\_seg\_and\_softmax  
File “C:\Users\Augusto\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\network\_architecture\neural\_network.py”, line 147, in predict\_3D  
File “C:\Users\Augusto\AppData\Local\NA-MIC\Slicer 5.2.1\lib\Python\Lib\site-packages\nnunet\network\_architecture\neural\_network.py”, line 356, in \_internal\_predict\_3D\_3Dconv\_tiled  
RuntimeError: CUDA out of memory. Tried to allocate 1.30 GiB (GPU 0; 2.00 GiB total capacity; 120.31 MiB already allocated; 1.17 GiB free; 150.00 MiB reserved in total by PyTorch)  
AttributeError: ‘DummyFile’ object has no attribute ‘flush’  
Resampling…  
Predicting…

---

_[View the full topic](https://discourse.slicer.org/t/totalsegmentator-error-at-first-run-command-python-scripts-totalsegmentator-returned-non-zero-exit-status-120/26755)._
