Comp2Comp
Comp2Comp copied to clipboard
contrast_phase pipeline broken due to TS weights unavailable
I tried running the contrast phase detection pipeline:
bin/C2C contrast_phase -i /data/dicom_dir/
This crashes with the following error:
Inference pipeline:
(1) DicomToNifti
(2) ContrastPhaseDetection
Starting inference pipeline for:
Running DicomToNifti with input keys odict_keys(['inference_pipeline'])
Finished DicomToNifti with output keys dict_keys([])
Running ContrastPhaseDetection with input keys odict_keys(['inference_pipeline'])
Segmenting...
Downloading pretrained weights for Task 251 (~230MB) ...
ERROR PROCESSING /data/dicom_dir
Traceback (most recent call last):
File "/code/Comp2Comp/comp2comp/utils/process.py", line 131, in process_3d
pipeline(output_dir=output_dir, model_dir=model_dir)
File "/code/Comp2Comp/comp2comp/inference_pipeline.py", line 73, in __call__
output = inference_class(inference_pipeline=self, **output)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/code/Comp2Comp/comp2comp/contrast_phase/contrast_phase.py", line 31, in __call__
seg, img = self.run_segmentation(
^^^^^^^^^^^^^^^^^^^^^^
File "/code/Comp2Comp/comp2comp/contrast_phase/contrast_phase.py", line 71, in run_segmentation
download_pretrained_weights(task_id)
File "/home/user/miniconda3/envs/c2c_env/lib/python3.11/site-packages/totalsegmentator/libs.py", line 194, in download_pretrained_weights
download_url_and_unpack(WEIGHTS_URL, config_dir)
File "/home/user/miniconda3/envs/c2c_env/lib/python3.11/site-packages/totalsegmentator/libs.py", line 80, in download_url_and_unpack
raise e
File "/home/user/miniconda3/envs/c2c_env/lib/python3.11/site-packages/totalsegmentator/libs.py", line 67, in download_url_and_unpack
r.raise_for_status()
File "/home/user/miniconda3/envs/c2c_env/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://zenodo.org/record/6802342/files/Task251_TotalSegmentator_part1_organs_1139subj.zip?download=1
It looks like the forked TotalSegmentatorV1's version is 1.5.3
:
$ pip list | grep Segmentator
TotalSegmentator 1.5.3
TotalSegmentatorV2 2.0.1
So it's unsurprising that zenodo downloads are failing, see https://github.com/wasserth/TotalSegmentator/issues/200
I thought I'd try a quick hack and ran pip install totalsegmentator==1.5.7
, but then I'm getting the following from bin/C2C contrast_phase
:
Traceback (most recent call last):
File "/code/Comp2Comp/bin/C2C", line 13, in <module>
from comp2comp.contrast_phase.contrast_phase import ContrastPhaseDetection
File "/code/Comp2Comp/comp2comp/contrast_phase/contrast_phase.py", line 6, in <module>
from totalsegmentator.libs import (
ImportError: cannot import name 'setup_nnunet' from 'totalsegmentator.libs' (/home/user/miniconda3/envs/c2c_env/lib/python3.11/site-packages/totalsegmentator/libs.py)