wkentaro / pytorch-fcn

PyTorch Implementation of Fully Convolutional Networks. (Training code to reproduce the original result is available.)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hi,I have a problem in running?

BCWang93 opened this issue · comments

commented

When I run the code ,I have this error like this:
'torch.Size([1, 21, 224, 320])# this is the output of the fcn32
torch.Size([1, 400, 500])# this is the target size
Traceback (most recent call last):
File "train.py", line 54, in
train(opt,model)
File "train.py", line 36, in train
loss=cross_entropy2d(outputs,label,size_average=False)
File "/home/a/Bcw_data/FCN/loss_fun/loss.py", line 12, in cross_entropy2d
log_p = log_p[target.view(n, h, w, 1).repeat(1, 1, 1, c) >= 0]
RuntimeError: shape '[1, 224, 320, 1]' is invalid for input of size 200000'
why this two size have so much difference?Anywhere I have error?Thanks!

Please request reopen if you still have this issue.