med-air / 3DSAM-adapter

Holistic Adaptation of SAM from 2D to 3D for Promptable Medical Image Segmentation
170 stars 12 forks source link

expected input to have 3 channels, but got 1 channels instead #38

Open FZJ2024 opened 4 months ago

FZJ2024 commented 4 months ago

File "/root/anaconda3/envs/Sam_PET/lib/python3.7/site-packages/segment_anything/modeling/image_encoder.py", line 392, in forward x = self.proj(x)

Given groups=1, weight of size [768, 3, 16, 16], expected input[2540, 1, 1596, 1596] to have 3 channels, but got 1 channels instead

Dear authors,

Could you please help me to solve this issue?

peterant330 commented 4 months ago

The input to the encoder should have three channels. Usually we just repeat the channel dimension three times to make it tri-channel.