Open wxr521314 opened 3 weeks ago
How can I solve this?
Hi @wxr521314, from the error message got [1, 275, 386, 386] at entry 0 and [1, 275, 380, 380] at entry 2
, it shows that the input shape are not the same after transforms, please check the shape of the data after the transforms.
Thanks.
Hi,I want to use batch_size = 2 for training. When using CenterSpatialCropd(keys=["image", "label"],roi_size=(224, 224, 224)), I can train the network, but when I use RandSpatialCropSamplesd(keys=["image", "label"],roi_size=(224, 224, 224), random_size=False, num_samples=2),ResizeWithPadOrCropd( keys=["image", "label"], spatial_size=224, mode='constant', ), the following error occurred.
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/opt/miniforge3/envs/monai/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "/opt/miniforge3/envs/monai/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch return self.collate_fn(data) File "/home/zhengsch/.local/lib/python3.9/site-packages/monai/data/utils.py", line 696, in pad_list_data_collate return PadListDataCollate(method=method, mode=mode, **kwargs)(batch) File "/home/zhengsch/.local/lib/python3.9/site-packages/monai/transforms/croppad/batch.py", line 114, in call return list_data_collate(batch) File "/home/zhengsch/.local/lib/python3.9/site-packages/monai/data/utils.py", line 529, in list_data_collate raise RuntimeError(re_str) from re RuntimeError: Trying to resize storage that is not resizable