RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [8, 1, 120, 224]], which is output 0 of SumBackward1, is at version 1; expected version 0 instead. Hint: the backtrace fu

It’s a bit hard to narrow down the issue from the stacktrace, but you should check if

  • you are explicitly using inplace operations and replace them with their out-of-place equivalents
  • you are trying to use stale forward activations as described in this post