Dear SCT team,
I run into an error using the seg_tumor_t2
task of sct_deepseg
for lesion segmentation. I’m currently using SCT 5.8 with WSL, and here’s the output:
--
Spinal Cord Toolbox (5.8)
sct_deepseg -i T2w_301.nii.gz -c t2 -task seg_tumor_t2
--
2023-07-07 21:23:43.791 | INFO | ivadomed.config_manager:_display_differing_keys:153 - Adding the following keys to the configuration file
2023-07-07 21:23:43.792 | INFO | ivadomed.config_manager:deep_dict_compare:44 - gpu_ids: [0]
2023-07-07 21:23:43.792 | INFO | ivadomed.config_manager:deep_dict_compare:44 - path_output: sc_model_30mm_32
2023-07-07 21:23:43.793 | INFO | ivadomed.config_manager:deep_dict_compare:44 - model_name: my_model
2023-07-07 21:23:43.793 | INFO | ivadomed.config_manager:deep_dict_compare:44 - log_file: log
2023-07-07 21:23:43.793 | INFO | ivadomed.config_manager:deep_dict_compare:44 - object_detection_params: path_output: sc_model_30mm_32
2023-07-07 21:23:43.794 | INFO | ivadomed.config_manager:deep_dict_compare:44 - wandb: {'wandb_api_key': '', 'project_name': 'my_project', 'group_name': 'my_group', 'run_name': 'run-1', 'log_grads_every': 100}
2023-07-07 21:23:43.794 | INFO | ivadomed.config_manager:deep_dict_compare:44 - loader_parameters: path_data: /home/GRAMES.POLYMTL.CA/anlemj/duke/temp/andreanne/tumor_segmentation_masks/results/data
2023-07-07 21:23:43.794 | INFO | ivadomed.config_manager:deep_dict_compare:44 - loader_parameters: subject_selection: {'n': [], 'metadata': [], 'value': []}
2023-07-07 21:23:43.795 | INFO | ivadomed.config_manager:deep_dict_compare:44 - loader_parameters: extensions: []
2023-07-07 21:23:43.795 | INFO | ivadomed.config_manager:deep_dict_compare:44 - loader_parameters: patch_filter_params: {'filter_empty_mask': False, 'filter_empty_input': False}
2023-07-07 21:23:43.795 | INFO | ivadomed.config_manager:deep_dict_compare:44 - loader_parameters: soft_gt: False
2023-07-07 21:23:43.795 | INFO | ivadomed.config_manager:deep_dict_compare:44 - loader_parameters: is_input_dropout: False
2023-07-07 21:23:43.795 | INFO | ivadomed.config_manager:deep_dict_compare:44 - object_detection_params: path_output: sc_model_30mm_32
2023-07-07 21:23:43.795 | INFO | ivadomed.config_manager:deep_dict_compare:44 - split_dataset: split_method: participant_id
2023-07-07 21:23:43.796 | INFO | ivadomed.config_manager:deep_dict_compare:44 - split_dataset: data_testing: {'data_type': None, 'data_value': []}
2023-07-07 21:23:43.796 | INFO | ivadomed.config_manager:deep_dict_compare:44 - split_dataset: balance: None
2023-07-07 21:23:43.796 | INFO | ivadomed.config_manager:deep_dict_compare:44 - lr_scheduler: name: CosineAnnealingLR
2023-07-07 21:23:43.796 | INFO | ivadomed.config_manager:deep_dict_compare:44 - balance_samples: applied: False
2023-07-07 21:23:43.797 | INFO | ivadomed.config_manager:deep_dict_compare:44 - balance_samples: type: gt
2023-07-07 21:23:43.797 | INFO | ivadomed.config_manager:deep_dict_compare:44 - transfer_learning: reset: True
2023-07-07 21:23:43.797 | INFO | ivadomed.config_manager:deep_dict_compare:44 - default_model: is_2d: True
2023-07-07 21:23:43.797 | INFO | ivadomed.config_manager:deep_dict_compare:44 - uncertainty: {'epistemic': False, 'aleatoric': False, 'n_it': 0}
2023-07-07 21:23:43.797 | INFO | ivadomed.config_manager:deep_dict_compare:44 - evaluation_parameters: object_detection_metrics: True
2023-07-07 21:23:43.798 | INFO | ivadomed.config_manager:deep_dict_compare:44 - Modified3DUNet: {'applied': True, 'length_3D': [512, 256, 32], 'stride_3D': [512, 256, 32], 'attention': False, 'n_filters': 8}
2023-07-07 21:23:43.798 | INFO | ivadomed.config_manager:_display_differing_keys:155 -
2023-07-07 21:23:43.798 | WARNING | ivadomed.inference:segment_volume:407 - fname_roi has not been specified, then the entire volume is processed.
2023-07-07 21:23:45.471 | INFO | ivadomed.inference:segment_volume:462 - Loaded 1 sagittal volumes of shape [512, 256, 32].
Traceback (most recent call last):
File "/home/ryanxu/sct_5.8/spinalcordtoolbox/scripts/sct_deepseg.py", line 253, in <module>
main(sys.argv[1:])
File "/home/ryanxu/sct_5.8/spinalcordtoolbox/scripts/sct_deepseg.py", line 215, in main
nii_lst, target_lst = imed_inference.segment_volume(path_model, input_filenames, options=options)
File "/home/ryanxu/sct_5.8/python/envs/venv_sct/lib/python3.8/site-packages/ivadomed/inference.py", line 495, in segment_volume
for i_batch, batch in enumerate(data_loader):
File "/home/ryanxu/sct_5.8/python/envs/venv_sct/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 530, in __next__
data = self._next_data()
File "/home/ryanxu/sct_5.8/python/envs/venv_sct/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 570, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/home/ryanxu/sct_5.8/python/envs/venv_sct/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/ryanxu/sct_5.8/python/envs/venv_sct/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/ryanxu/sct_5.8/python/envs/venv_sct/lib/python3.8/site-packages/ivadomed/loader/mri3d_subvolume_segmentation_dataset.py", line 220, in __getitem__
stack_input, metadata_input = self.transform(sample=stack_input,
File "/home/ryanxu/sct_5.8/python/envs/venv_sct/lib/python3.8/site-packages/ivadomed/transforms.py", line 156, in __call__
sample, metadata = tr(sample, metadata)
File "/home/ryanxu/sct_5.8/python/envs/venv_sct/lib/python3.8/site-packages/ivadomed/transforms.py", line 53, in wrapper
return wrapped(self, sample, metadata)
File "/home/ryanxu/sct_5.8/python/envs/venv_sct/lib/python3.8/site-packages/ivadomed/transforms.py", line 79, in wrapper
return wrapped(self, sample, metadata)
File "/home/ryanxu/sct_5.8/python/envs/venv_sct/lib/python3.8/site-packages/ivadomed/transforms.py", line 719, in __call__
metadata[MetadataKW.ROTATION] = [angle, axes]
TypeError: list indices must be integers or slices, not str
I have tried reinstalling the task but still get the same error.
Hope someone can work this out. I’ll appreciate any help.
Regards,
Ryan