HiLab-git / SSL4MIS

Semi Supervised Learning for Medical Image Segmentation, a collection of literature reviews and code implementations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RGB Input

atgc1984 opened this issue · comments

Hello,
Suppose I have datasets with RGB channels, should I use the 3d models? I simply changed in_chns to 3 and feed data with shape (bs, 3, 256, 256) but it would give errors, for both unet_3d and attention unet:
RuntimeError: Given groups=1, weight of size [16, 3, 3, 3, 3], expected input[32, 1, 9, 256, 256] to have 3 channels, but got 1 channels instead

This error came from conv1 = self.conv1(inputs)
Is there anything that I missed? It would be greatly appreciated if you could provide training/testing scripts for RGB images since they are more usual.
Thank you very much.

Hi,
Firstly, you should use the 2D network to segment your RGB images rather than 3D networks, like here using in_chns=3 to replace in_chns=1 is enough. Secondly, we do not plan to provide training/testing scripts for RGB images, as there is no difference between Gray images and RGB images except the input channels. Finally, do not forget to star or cite our repository/papers if it is useful for your research or study :)
Best,
Xiangde.