Advertisement

pytorch RuntimeError: one of the variables needed for gradient computation has been modified by an i

阅读量:
复制代码
    RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [25088, 512]], which is output 0 of TBackward, is at version 4; expected version 3 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).
    
    
    python

在pytorch框架中,关于梯度的更新机制,当将多次执行的update操作调整为仅进行一次update后,原先存在的错误现象便不再出现。

全部评论 (0)

还没有任何评论哟~