You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function segment_volume fails after the merge of #818 when segmenting with a model containing the "NumpyToTensor": {} field in transformation parameters. (tagging @dyt811 and @cakester so they are aware)
I found this #758 (comment) on the opened PR #758 with what seems to be a fix for this. If that is the case, I think the fix should be done in a dedicated PR as soon as possible.
Current behavior
Config file of models trained prior to the merge of #818 contains the "NumpyToTensor": {} field. This config file is used by the function segment_volume for segmentation.
The segmentation fails with the following error when undoing transforms:
Traceback (most recent call last):
File "/home/mhbourget/venv-ivadomed-38c/bin/ivadomed", line 11, in <module>
load_entry_point('ivadomed', 'console_scripts', 'ivadomed')()
File "/home/mhbourget/ivadomed/ivadomed/main.py", line 560, in run_main
run_command(context=context,
File "/home/mhbourget/ivadomed/ivadomed/main.py", line 340, in run_command
run_segment_command(context, model_params)
File "/home/mhbourget/ivadomed/ivadomed/main.py", line 274, in run_segment_command
pred_list, target_list = imed_inference.segment_volume(path_model,
File "/home/mhbourget/ivadomed/ivadomed/inference.py", line 407, in segment_volume
pred_list, target_list, last_sample_bool, weight_matrix, volume, image = reconstruct_3d_object(
File "/home/mhbourget/ivadomed/ivadomed/inference.py", line 483, in reconstruct_3d_object
image_reconstruction(batch, preds, undo_transforms, i_slice, image, weight_matrix)
File "/home/mhbourget/ivadomed/ivadomed/inference.py", line 609, in image_reconstruction
pred_undo, metadata = undo_transforms(image, batch['gt_metadata'][smp_idx], data_type='gt')
File "/home/mhbourget/ivadomed/ivadomed/transforms.py", line 184, in __call__
sample, metadata = tr.undo_transform(sample, metadata)
File "/home/mhbourget/ivadomed/ivadomed/transforms.py", line 210, in undo_transform
return list(sample.numpy()), metadata
AttributeError: 'list' object has no attribute 'numpy'
Note: a newly trained model without the NumpyToTensor key does not produced this error.
Expected behavior
"NumpyToTensor": {} field from old config files should be ignored somehow to ensure retrocompatibility and avoid this error.
functional_tests/test_segment_volume.py should test for this. This is not the case right now and tests are passing because they don't use old config files.
The text was updated successfully, but these errors were encountered:
Issue description
The function
segment_volume
fails after the merge of #818 when segmenting with a model containing the"NumpyToTensor": {}
field in transformation parameters. (tagging @dyt811 and @cakester so they are aware)I found this #758 (comment) on the opened PR #758 with what seems to be a fix for this. If that is the case, I think the fix should be done in a dedicated PR as soon as possible.
Current behavior
Config file of models trained prior to the merge of #818 contains the
"NumpyToTensor": {}
field. This config file is used by the functionsegment_volume
for segmentation.The segmentation fails with the following error when undoing transforms:
Note: a newly trained model without the
NumpyToTensor
key does not produced this error.Expected behavior
"NumpyToTensor": {}
field from old config files should be ignored somehow to ensure retrocompatibility and avoid this error.functional_tests/test_segment_volume.py
should test for this. This is not the case right now and tests are passing because they don't use old config files.The text was updated successfully, but these errors were encountered: