Not much useful I think. I’ve been thinking about it, and I think it might be something to do with having two separate models (and two separate loss functions)?
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-8-5eb175a81d8f> in <module>()
     16     loss = criterion(output, l_temp)
     17     print(output.size(), loss.size())
---> 18     loss.backward()
     19     optimizer.step()
     20 

1 frames
/usr/local/lib/python3.6/dist-packages/torch/autograd/__init__.py in backward(tensors, grad_tensors, retain_graph, create_graph, grad_variables)
     98     Variable._execution_engine.run_backward(
     99         tensors, grad_tensors, retain_graph, create_graph,
--> 100         allow_unreachable=True)  # allow_unreachable flag
    101 
    102 

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [480, 7]] is at version 50; expected version 49 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck!