pytorch-YOLOv4 icon indicating copy to clipboard operation
pytorch-YOLOv4 copied to clipboard

I can not run train because the gradient can not be counted

Open qam1314 opened this issue 3 years ago • 2 comments

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [1, 3, 19, 19, 121]], which is output 0 of AsStridedBackward, is at version 6; expected version 3 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!

qam1314 avatar May 24 '21 16:05 qam1314

Is this problem solved? I got the same problem

JiaweiLian avatar Jun 05 '21 03:06 JiaweiLian

@qam1314 @JiaweiLian Check that you are using pytorch version 1.4.0 as illustrated in requirement.txt. That solved the problem in my case.

JustWon avatar Sep 19 '21 02:09 JustWon