AssertionError: ground truth has different shape (torch.Size([1, 3, 128, 128, 127])) from input (torch.Size([1, 3, 128, 128, 128])) #4007
Replies: 2 comments 1 reply
-
I think it makes sense that the preprocessing defined here is unstable. Because of the |
Beta Was this translation helpful? Give feedback.
-
@ankitabuntolia from torch import nn |
Beta Was this translation helpful? Give feedback.
-
Problem:
After running 122 epoch, at 123rd epoch DiceLoss throwing an error,
AssertionError: ground truth has different shape (torch.Size([1, 3, 128, 128, 127])) from input (torch.Size([1, 3, 128, 128, 128]))
My question is why I am getting this error after running 122 epochs successfully? and How can I get rid of it?
Background of task
I am working on 3D OCT Image segmentation to identify IRF, SRF, and PED fluids using Monai. My input image size is 512x496x49 and my label is also 512x496x49. An image can have 3 labels (IRF, SRF, and PED) so it's a multilabel segmentation task.
After using transform, the shape of image changes to torch.Size([1, 128, 128, 128]), label shape: torch.Size([3, 128, 128, 128]).
My Transform
I am following Brain tumor 3D segmentation with MONAI but instead of using its model, I am using it from Tutorial: Spleen 3D segmentation with MONAI with adjustment provided by #415.
Here is my model:
I am using training code from Brain tumor 3D segmentation with MONAI
At 123rd epoch, my training is throwing this error:
Beta Was this translation helpful? Give feedback.
All reactions