reinforcement-learning-kr / lets-do-irl

Inverse RL algorithms (APP, MaxEnt, GAIL, VAIL)
MIT License
693 stars 112 forks source link

RunTimeError with vail #12

Open luminous-123 opened 1 year ago

luminous-123 commented 1 year ago

when i run main.py ,i met some problem: Traceback (most recent call last): File "main.py", line 186, in main() File "main.py", line 159, in main expert_acc, learner_acc = train_vdb(vdb, memory, vdb_optim, demonstrations, 0, args) File "/home/parallels/workspace/lets-do-irl-master/mujoco/vail/train_model.py", line 37, in train_vdb vdb_loss.backward(retain_graph=True) File "/home/parallels/anaconda3/envs/mujoco/lib/python3.8/site-packages/torch/_tensor.py", line 487, in backward torch.autograd.backward( File "/home/parallels/anaconda3/envs/mujoco/lib/python3.8/site-packages/torch/autograd/init.py", line 197, in backward Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [100, 4]], which is output 0 of AsStridedBackward0, is at version 35; expected version 34 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!

salmankdurrani commented 11 months ago

Hello, I have just started learning IRL. it's really hard for me to work through this library. can you please help me understand the code?