RuntimeError: Given groups=1, weight of size [64, 3, 7, 7], expected input[1, 1000, 512, 512] to have 3 channels, but got 1000 channels instead
The length of train set is: 206
206 iterations per epoch. 20600 max iterations
0%| | 0/100 [02:11<?, ?it/s]
Traceback (most recent call last):
File "E:/AI/SUnetOK/TransUnet/TransUNet-main/train.py", line 93, in
trainer[dataset_name](args, net, snapshot_path)
File "E:\AI\SUnetOK\TransUnet\TransUNet-main\trainer.py", line 55, in trainer_synapse
outputs = model(image_batch)
File "D:\InstallAPP\Anocanda\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\AI\SUnetOK\TransUnet\TransUNet-main\networks\vit_seg_modeling.py", line 388, in forward
x, attn_weights, features = self.transformer(x) # (B, n_patch, hidden)
File "D:\InstallAPP\Anocanda\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\AI\SUnetOK\TransUnet\TransUNet-main\networks\vit_seg_modeling.py", line 254, in forward
embedding_output, features = self.embeddings(input_ids)
File "D:\InstallAPP\Anocanda\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\AI\SUnetOK\TransUnet\TransUNet-main\networks\vit_seg_modeling.py", line 156, in forward
x, features = self.hybrid_model(x)
File "D:\InstallAPP\Anocanda\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\AI\SUnetOK\TransUnet\TransUNet-main\networks\vit_seg_modeling_resnet_skip.py", line 145, in forward
x = self.root(x)
File "D:\InstallAPP\Anocanda\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "D:\InstallAPP\Anocanda\lib\site-packages\torch\nn\modules\container.py", line 117, in forward
input = module(input)
File "D:\InstallAPP\Anocanda\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\AI\SUnetOK\TransUnet\TransUNet-main\networks\vit_seg_modeling_resnet_skip.py", line 25, in forward
self.dilation, self.groups)
RuntimeError: Given groups=1, weight of size [64, 3, 7, 7], expected input[1, 1000, 512, 512] to have 3 channels, but got 1000 channels instead
Process finished with exit code 1
RuntimeError: Given groups=1, weight of size [64, 3, 7, 7], expected input[1, 1000, 512, 512] to have 3 channels, but got 1000 channels instead
Sorry to bother you. Could you be so kind to share the training and test data? My email is [email protected].