RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [3, 1]], which is output 0 of TanhBackward, is at version 1; expected version 0 instead

Parameters are update inplace by optimizers as seen here.
@Raphael_Emeka if you think this might be the issue, you might be running into this issue and would need to check your wokflow to make sure no stale forward activations are used.

2 Likes