YixingHuang / DeepMedicPlus

Deep learning for brain metastasis detection and segmentation in longitudinal MRI data
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

List index out of range when running inference #3

Closed damiankucharski closed 1 year ago

damiankucharski commented 1 year ago

Hello @YixingHuang, I managed to setup the libraries in correct version and probably configs too. However, when I am running the following command

python deepMedicRun -model ./examples/configFiles/deepMedicPlus/model/modelConfig_wide1_deeper.cfg -test ./examples/configFiles/deepMedicPlus/test/testConfig.cfg -load ./examples/output/saved_models/pretrainedModels/deepMedicWide1.high_sensitivity.model.ckpt -dev cuda0

I am getting such an error:

##########################################################################################
#                 Starting full Segmentation of Testing subjects                        #
##########################################################################################

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~         Segmenting subject with index #0       ~~~~~~~~
 Loading subject with 1st channel at: /home/kucharsd/Documents/Git/DeepMedicPlus/DeepMedicPlus/examples/data_test/PATIENT1002_VISIT2_T1CE.nii.gz

ERROR: Caught exception from main process: list index out of range
Traceback (most recent call last):
  File "/home/kucharsd/Documents/Git/DeepMedicPlus/DeepMedicPlus/deepMedicRun", line 180, in <module>
    session.run_session(sess_device, model_params)
  File "/home/kucharsd/Documents/Git/DeepMedicPlus/DeepMedicPlus/deepmedic/frontEnd/testSession.py", line 129, in run_session
    res_code = inference_on_whole_volumes(*([sessionTf, cnn3d] +
  File "/home/kucharsd/Documents/Git/DeepMedicPlus/DeepMedicPlus/deepmedic/routines/testing.py", line 542, in inference_on_whole_volumes
    _) = load_imgs_of_subject(log, "",
  File "/home/kucharsd/Documents/Git/DeepMedicPlus/DeepMedicPlus/deepmedic/dataManagement/sampling.py", line 473, in load_imgs_of_subject
    path_to_lbl = paths_to_lbls_per_subj[subj_i]
IndexError: list index out of range

Finished.

I have set up testChannels_t1c.cfg and testPriorChannels_t1c.cfg as mentioned in https://github.com/YixingHuang/DeepMedicPlus/issues/2 I have also removed the contents of testGtLabels.cfg and testRoiMasks.cfg

Do I need to put anything in them and prepare some additional file to run the model? Thank you very much for your help!

YixingHuang commented 1 year ago

Hi @damiankucharski

"I have also removed the contents of testGtLabels.cfg and testRoiMasks.cfg": you also need to put the corresponding paths for the testRoiMasks.cfg and testGtLabels.cfg (for computing prediction accuracy).

damiankucharski commented 1 year ago

Thanks @YixingHuang, I prepared the files and it went further but I am getting another error. I will open next issue.