Hello @ptrblck , thank you for your reply. But after changing to “loss=loss+loss_fn(data_target[e-D,t],data_out[e-D,t])” I just got the same error:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [1, 3]] is at version 120; expected version 119 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).