Setting value for hidden_channels in FullyConnectedNet model #6749
-
Hello, I'm a novice in AI and image segmentation. model = FCN(
in_channels=1,
out_channels=3,
hidden_channels=[10],
dropout=0.20,
) and used this tutorial here for running the trainer. While the trainer is running, on the RuntimeError: mat1 and mat2 shapes cannot be multiplied (4x884736 and 1x10) To avoid this issue, I changed the AssertionError: ground truth has different shape (torch.Size([4, 2, 96, 96, 96])) from input (torch.Size([4, 2])) Now I have two related questions regarding the situation:
Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I've read the source code for this model here and still couldn't figure out how to set values for |
Beta Was this translation helpful? Give feedback.
-
Hi @Kiarashdnsh, thanks for your interest here. I guess you want to use the 'fully convolutional network' (FCN) model to segment your images instead of the fully-connected network ( MONAI/monai/networks/nets/fullyconnectednet.py Lines 33 to 35 in 4addc5d As a first step, I recommend that you try 'UNet' (a popular variant of FCN); here is a tutorial of a basic UNet training example. (https://github.com/Project-MONAI/tutorials/blob/main/3d_segmentation/torch/unet_training_array.py) Hope it helps, thanks! |
Beta Was this translation helpful? Give feedback.
Hi @Kiarashdnsh, thanks for your interest here.
I guess you want to use the 'fully convolutional network' (FCN) model to segment your images instead of the fully-connected network (
FullyConnectedNet
) which is used to do classification.FullyConnectedNet
should accept one-dimensional data, shape like Batch_size*Channel.MONAI/monai/networks/nets/fullyconnectednet.py
Lines 33 to 35 in 4addc5d