您好,在我按照您的步骤训练时出现了如下错误:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1, 32, 1]], which is output 0 of IndexPutBackward, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).
i also have the problem, and i do this as you say. now it works. But i am stll trobuled by this problem. i have no idea about it.
The error i encountered can be seen in the picture below.
您好,在我按照您的步骤训练时出现了如下错误: RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1, 32, 1]], which is output 0 of IndexPutBackward, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).
当我去掉 loss['coor_loss'].mean()*coor_weight 这句代码时就可以正常训练了,请问这是什么原因呢