TransUNet icon indicating copy to clipboard operation
TransUNet copied to clipboard

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

Open baoqicha opened this issue 2 years ago • 2 comments

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

baoqicha avatar May 06 '22 08:05 baoqicha

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

baoqicha avatar May 10 '22 01:05 baoqicha

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].

AXu0511 avatar Aug 06 '22 05:08 AXu0511