I meet a problem when I calculating the loss function.
Traceback (most recent call last):
  File "train.py", line 122, in <module>
    g_loss.backward()
  File "/nas/longleaf/home/lehuang/tool/anaconda/envs/deephic/lib/python3.7/site-packages/torch/tensor.py", line 221, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/nas/longleaf/home/lehuang/tool/anaconda/envs/deephic/lib/python3.7/site-packages/torch/autograd/__init__.py", line 132, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1, 256, 1, 1]] 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).