This seems to be a torch problem.
Could you install 3D Slicer 5.6.1 into a new directory and just install Pytorch, LungCTAnalyzer and TotalSegmentator extensions ?
And determine the version of torch as shown here ?
@rsalkin If you switch to the “PyTorch Utils” module in Slicer, what version of Torch does it show that is currently installed?
@rbumm What is the minimum torch version requirement to use your LungCTSegmenter module? I see that your code checks if torch is present and that CUDA support is available, but it doesn’t check a specific torch version requirement?
Below is example usage of SlicerTotalSegmentator enforcing a minimum torch version.
It appears that lungmask specifies no torch version which can result in incompatibilities of an older torch version not working.
The Pytorch Utils module only let me install up to version 1.8.1+cpu but I was able to manually install version 2.1.2+cpu via the python console (Pytorch extension installation) and now the segmenter is working.
Thanks Dr. Bumm for answering my question. The module has been extremely helpful.
This is just for the CPU version as my computer does not have a capable GPU for PyTorch.
You first have to go to the PyTorch Utils module (see below) in slicer then select uninstall PyTorch (if you uninstall via the python console slicer.util.pip_uninstall("torch") it doesn’t work and crashes when you try to uninstall via the Utils module afterwards, assuming the original PyTorch installation used the Utils module).
Restart Slicer after removing PyTorch then run the line:
For some reason, on some computers these ancient PyTorch 1.x versions are installed by default.
We added the “torch version requirement” field to PyTorch Utils module to make it very easy to install a more recent version. For example, you can type >2 in that field and click Install PyTorch.
@rsalkin Do you have any recommendation of how to make it more clear that the required pytorch version can be specified in Pytorch Utils module? Maybe changing the placeholder text from “default” to something like “specify version requirement here” would help?
@rbumm I would recommend to copy the PyTorch version check that @jamesobutler highlighted from TotalSegmentator module to the LungCTSegmenter module.
Hi Andras, I think that could be good, otherwise it might be simpler to have a drop down menu and select either latest stable version, system default version, or a specify system version where you can then type which one you want, i.e. x.x. That way its easy for someone not to have to look up the first two and give the optionality if a module is very specific for the last option.