When I execute the training command, there is an error of feature dimension. Displays dimensional errors in feature alignment.
Traceback (most recent call last):
File "project/train.py", line 114, in
main()
File "project/train.py", line 107, in main
train(dataloader, i)
File "project/train.py", line 46, in train
doc = net(img)
File "/media/yangxilab/DiskA/anaconda3/envs/yuyi/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/media/yangxilab/DiskB/zjn/yuyi/ImageCompressionNN/project/models.py", line 19, in forward
return self.encoder(img)
File "/media/yangxilab/DiskA/anaconda3/envs/yuyi/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/media/yangxilab/DiskB/zjn/yuyi/ImageCompressionNN/project/models.py", line 139, in forward
y = self.align()
File "/media/yangxilab/DiskB/zjn/yuyi/ImageCompressionNN/project/models.py", line 116, in align
y += conv(coef)
RuntimeError: The size of tensor a (64) must match the size of tensor b (1019) at non-singleton dimension 3
The relevant information is printed as follows:
y torch.Size([32, 32, 64])
coef torch.Size([8, 64, 256, 256])
conv ConvTranspose2d(64, 64, kernel_size=(3, 3), stride=(4, 4), padding=(1, 1))
conv(coef) torch.Size([8, 64, 1021, 1021])