C:\Users\lli4\Anaconda3\lib\site-packages\torch\autograd_init_.py:130: UserWarning: Error detected in MmBackward. Traceback of forward call that caused the error:
File “D:/workspace/POMDP_CODE/ubvo/ubvo.py”, line 302, in 
agent.train(product_pomdp)
File “D:/workspace/POMDP_CODE/ubvo/ubvo.py”, line 139, in train
e_v = self.e_vio(trajs, self.mu)
File “D:/workspace/POMDP_CODE/ubvo/ubvo.py”, line 24, in e_vio
f[i] = self.traj_v(trajs[i], mu)
File “D:/workspace/POMDP_CODE/ubvo/ubvo.py”, line 32, in traj_v
h_g[i] = self.step_v(y, ny, mu)
File “D:/workspace/POMDP_CODE/ubvo/ubvo.py”, line 41, in step_v
g = mu * torch.log(torch.sum(f)) - self.value.getValue(y, mu)
File “D:/workspace/POMDP_CODE/ubvo/ubvo.py”, line 265, in getValue
temp[i] = torch.exp(self.getQValue(y, i) / mu)
File “D:/workspace/POMDP_CODE/ubvo/ubvo.py”, line 259, in getQValue
value = self.model(input)
File “C:\Users\lli4\Anaconda3\lib\site-packages\torch\nn\modules\module.py”, line 727, in _call_impl
result = self.forward(*input, **kwargs)
File “D:\workspace\POMDP_CODE\models\nn_model.py”, line 15, in forward
x = self.l3(x)
File “C:\Users\lli4\Anaconda3\lib\site-packages\torch\nn\modules\module.py”, line 727, in _call_impl
result = self.forward(*input, **kwargs)
File “C:\Users\lli4\Anaconda3\lib\site-packages\torch\nn\modules\linear.py”, line 93, in forward
return F.linear(input, self.weight, self.bias)
File “C:\Users\lli4\Anaconda3\lib\site-packages\torch\nn\functional.py”, line 1692, in linear
output = input.matmul(weight.t())
(Triggered internally at  …\torch\csrc\autograd\python_anomaly_mode.cpp:104.)
Variable.execution_engine.run_backward(
Traceback (most recent call last):
File “D:/workspace/POMDP_CODE/ubvo/ubvo.py”, line 302, in 
agent.train(product_pomdp)
File “D:/workspace/POMDP_CODE/ubvo/ubvo.py”, line 132, in train
loss.backward(retain_graph=True)
File “C:\Users\lli4\Anaconda3\lib\site-packages\torch\tensor.py”, line 221, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "C:\Users\lli4\Anaconda3\lib\site-packages\torch\autograd_init.py", line 130, in backward
Variable._execution_engine.run_backward(
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [128, 1]], which is output 0 of TBackward, is at version 4; expected version 3 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!