RuntimeError: The size of tensor a (64) must match the size of tensor b (3) at non-singleton dimension 1
white2018 opened this issue · comments
Nice job! @geekyutao cound you pls tell me how to fix the following problem? Thanks a lot
Traceback (most recent call last):
File "main.py", line 286, in
train(epoch)
File "main.py", line 83, in train
prediction = model.generator(gt, mask)
File "/home/asiainfo/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 539, in call
result = self.forward(*input, **kwargs)
File "/home/wanghz/rn/networks.py", line 76, in forward
x = self.encoder(x, mask)
File "/home/wanghz/rn/networks.py", line 60, in encoder
x = self.encoder_in1(x, mask)
File "/home/asiainfo/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 539, in call
result = self.forward(*input, **kwargs)
File "/home/wanghz/rn/rn.py", line 64, in forward
rn_x = self.rn(x, mask)
File "/home/asiainfo/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 539, in call
result = self.forward(*input, **kwargs)
File "/home/wanghz/rn/rn.py", line 18, in forward
rn_foreground_region = self.rn(x * label, label)
RuntimeError: The size of tensor a (64) must match the size of tensor b (3) at non-singleton dimension 1
Problem solved, which is caused by training mask size issue
怎么解决的啊,我都没改源码,只是改了下参数
怎么解决的啊,我都没改源码,只是改了下参数
the mask returned from load_item() must be only one channel.