BioMedIA / UKBB-GNC-Abdominal-Segmentation

Abdominal Organ Segmentation of UK Biobank and GNC Studies
Apache License 2.0
3 stars 6 forks source link

Links to single channel models broken #2

Closed hhaentze closed 1 year ago

hhaentze commented 1 year ago

Problem

When trying to segment images with a 1-channel model

python predict.py --nnunet_folder nnunet_folder --prediction_folder pred_folder --dataset_name gnc --num_channels 1

this results in:

2023-07-12 13:01:16,377: Started predict...
2023-07-12 13:01:16,377: CUDA_VISIBLE_DEVICES: 0
2023-07-12 13:01:16,377: RESULTS_FOLDER: models/
2023-07-12 13:01:16,377: nnunet_folder: /home/myhome/UKBB-GNC-Abdominal-Segmentation/nnunet_folder
2023-07-12 13:01:16,377: prediction_folder: /home/myhome/UKBB-GNC-Abdominal-Segmentation/pred_folder
2023-07-12 13:01:16,377: dataset_name: gnc
2023-07-12 13:01:16,377: num_channels: 1

2023-07-12 13:01:16,378: model_location: models/nnUNet/3d_fullres/Task504_gnc_1ch/nnUNetTrainerV2__nnUNetPlansv2.1/all/model_final_checkpoint.model

2023-07-12 13:01:16,378: Downloading: [Dataset: gnc, Number_of_Channels:1]...
Traceback (most recent call last):
  File "/home/myhome/UKBB-GNC-Abdominal-Segmentation/predict.py", line 126, in <module>
    main()
  File "/home/myhome/UKBB-GNC-Abdominal-Segmentation/predict.py", line 94, in main
    urllib.request.urlretrieve(retrieval_url, retrival_name)
  File "/home/myhome/.conda/envs/abdomennet/lib/python3.11/urllib/request.py", line 241, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
                            ^^^^^^^^^^^^^^^^^^
  File "/home/myhome/.conda/envs/abdomennet/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/myhome/.conda/envs/abdomennet/lib/python3.11/urllib/request.py", line 525, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "/home/myhome/.conda/envs/abdomennet/lib/python3.11/urllib/request.py", line 634, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "/home/myhome/.conda/envs/abdomennet/lib/python3.11/urllib/request.py", line 563, in error
    return self._call_chain(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/myhome/.conda/envs/abdomennet/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/home/myhome/.conda/envs/abdomennet/lib/python3.11/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

This happens for both gnc and ukbb datasets.

Expected Results

"predict.py" should download the corresponding model and use it for inference.

Remarks

I checked the urls in "predict.py" manually and both urls pointing to a single channel model raised a 404 Exception, while the urls to the 4-channel models worked fine.

turkaykart commented 1 year ago

Hello,

Thank you for getting in touch.

The repo is now updated accordingly. Could you please try it and see if it works for you? If it doesn't, feel free to reopen the issue.

Many thanks, Turkay