davidiommi / Pytorch--3D-Medical-Images-Segmentation--SALMON

Segmentation deep learning ALgorithm based on MONai toolbox: single and multi-label segmentation software developed by QIMP team-Vienna.
https://zmpbmt.meduniwien.ac.at/wissenschaft-forschung/qimp/
MIT License
120 stars 26 forks source link

Error in feeding input with Batch=4. #10

Open Almadani92 opened 2 years ago

Almadani92 commented 2 years ago

When using the code and feed the input image with size [4,1,256,256,16] (which the number 4 in the first dimension is the batch size), I am having the following error: .local/lib/python3.9/site-packages/monai/networks/blocks/dynunet_block.py", line 216, in forward out = torch.cat((out, skip), dim=1) RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 10 but got size 9 for tensor number 1 in the list.

However, when I use the batch size equal to 1 the code works, but the loss is not decreasing.

My question is that how I can feed the input with batch size equal to 4 without getting this error?