lyongo/NWPU-MOC

gradient computation problems

Opened this issue · 3 comments

I follow the instruction as described in readme.md, and when I running python3 train.py‘, errors occured, I googled and try to modify inplace=True' into 'inplace=False', but that does not help.

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [4, 128, 64, 64]], which is output 0 of ReluBackward0, is at version 1; expected version 0 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck!

You can try to edit the 101 row of /models/FPN/FPN_Head.py.Chage += into =

Thanks ,that works

您可以尝试将 /models/FPN/FPN_Head.py.Chage += 的 101 行编辑为 =
您好,我不太清楚您说的是哪里,我的101行内容是这样的:laterals[i - 1] += F.interpolate(laterals[i], size=prev_shape, mode='nearest')