pytorch-soft-actor-critic icon indicating copy to clipboard operation
pytorch-soft-actor-critic copied to clipboard

Running SAC: Operation failed to compute its gradient

Open ian-cannon opened this issue 4 years ago • 3 comments

Environment:

  • torch==1.5.0
  • mujoco-py==2.0.2.10

Usage: python main.py --env-name Humanoid-v2 --alpha 0.05

Error: RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [256, 1]], which is output 0 of TBackward, is at version 3; expected version 2 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!

Hello there, I am trying to run SAC and am getting the error shown above. I was told that rolling back to Torch 1.0.0 would fix the issue(installing now), but I do not understand why. Is this something that you are aware of?

ian-cannon avatar Jun 25 '20 14:06 ian-cannon

I have verified, the code still works with Torch 1.0.0

ian-cannon avatar Jun 25 '20 17:06 ian-cannon

It is working

Git clone again and try

pranz24 avatar Jun 26 '20 05:06 pranz24

I use torch==1.4.0 can fix this.

cuijianaaa avatar Sep 18 '22 08:09 cuijianaaa