自己在修改网络结构的时候发现如下问题 但是在网上一直找也没有找到,求指点!!
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [7594, 64]] is at version 2; expected version 1 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!
python-BaseException
使用torch.autograd.set_detect_anomaly(True)进一步寻找问题 发现了
[W ..\torch\csrc\autograd\python_anomaly_mode.cpp:104] Warning: Error detected in StackBackward. Traceback of forward call that caused the error:
但是一直没有找到解决办法
