Failed to compute results. No module named 'torch'

Hi,
I’m having trouble applying the program ‘Total Segmentator’. I’ve tried every possible method below Mr Anish_Raj’s question posted on December 22, 2022 but still encountered a failure about PyTorch as mentioned in the topic.
Detailed error:
Traceback (most recent call last):
File “E:\Slicer 5.2.2\bin\Python\slicer\util.py”, line 2967, in tryWithErrorDisplay
yield
File “E:/Slicer 5.2.2/NA-MIC/Extensions-31382/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 255, in onApplyButton
self.logic.setupPythonRequirements()
File “E:/Slicer 5.2.2/NA-MIC/Extensions-31382/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 618, in setupPythonRequirements
torch = torchLogic.installTorch(askConfirmation=True)
File “E:/Slicer 5.2.2/NA-MIC/Extensions-31382/PyTorch/lib/Slicer-5.2/qt-scripted-modules/PyTorchUtils.py”, line 195, in installTorch
import torch
ModuleNotFoundError: No module named ‘torch’
Please tell me which steps need to be corrected,
Thanks.

Please start all over again and follow these instructions.

Thanks a lot for your instructions, it turned out to be a problem with the modules of Python that I installed before, and the performance of my hardware was not good enough for some examples about image processing. I tried your steps again strictly in the lab for postgraduates and got the results successfully.

2 Likes