Replies: 5 comments
-
Hi @tararelan, could you please share the whole error message? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hi @tararelan, could you please try
|
Beta Was this translation helpful? Give feedback.
-
Hi, I used Dataset instead of the customised one and it works. However, when I try to train my model using:
I get the following error:
|
Beta Was this translation helpful? Give feedback.
-
Hi @tararelan, could you please share a reproducible code then I can take a deep look at it? Please check your data after transforms and run the code step by step to see where the size mismatch is. Thanks. (Move to discussion, more like a usage issue) |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
I'm trying to check the images after they've been loaded using the following code:
However, I receive the following error:
RuntimeError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/monai/transforms/transform.py in apply_transform(transform, data, map_items, unpack_items, log_stats, lazy, overrides)
140 return [_apply_transform(transform, item, unpack_items, lazy, overrides, log_stats) for item in data]
--> 141 return _apply_transform(transform, data, unpack_items, lazy, overrides, log_stats)
142 except Exception as e:
15 frames
RuntimeError: The size of tensor a (7663256) must match the size of tensor b (4919040) at non-singleton dimension 0
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/monai/transforms/transform.py in apply_transform(transform, data, map_items, unpack_items, log_stats, lazy, overrides)
169 else:
170 _log_stats(data=data)
--> 171 raise RuntimeError(f"applying transform {transform}") from e
172
173
RuntimeError: applying transform <monai.transforms.croppad.dictionary.RandCropByPosNegLabeld object at 0x7c03133b0fa0>
Expected behavior
I expect to get images of each slice of the CT scan.
Environment
Beta Was this translation helpful? Give feedback.
All reactions