problem with number of input channels, using spleen_segmentation_3d.ipynb with own dataset #1443
-
Hi, I try to train the model using the tutorial spleen_segmentation_3d.ipynb with my own mri dataset but I keep having errors. I wonder if anyone can help. I saved my images in nii.gz. Each has dimension 256x256x16. Labelmap (binary) is also saved in nii.gz as labelmap volume rather than scalar volume. The labelmap shows 1 for tumor and 0 otherwise. Dimension of masked labelmap is the same as image. I used the same augmentation transformation for both training and validation sets, and modified some parameters:
and
The remaining codes are pretty much the same as tutorial. I got the RuntimeError that Given groups=1, weight of size [16, 1, 3, 3, 3], expected input[1, 2, 256, 256, 16] to have 1 channels, but got 2 channels instead. I googled about this error but most of the solutions are to manually change the parameters in convolutional layers. In this tutorial, we use To check the transforms in dataloader, the tutorial uses |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @esther1262, could you please try |
Beta Was this translation helpful? Give feedback.
Hi @esther1262, could you please try
LoadImaged(keys=["image", "label"], ensure_channel_first=True)
in your code and see what comes out? Seems you didn't add a channel dim in the transform chain.Hope it can help you.
Thanks!