[PyTorch] RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation 에러
에러명은 아래와 같았다. RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [64, 4]], which is output 0 of SoftmaxBackward, is at version 64; expected version 0 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True). 원인을 자세히 보면, inplace opera..