Closed harishbommakanti closed 3 years ago
Hmmmm, it sounds like it's a PyTorch related issue. Which version are you currently running? Can you verify that it's version 1.4.0?
Oh, that looks like its the problem. I had version 1.6.0 installed but it worked when I changed the version. Thanks!
I ran into the same error. I found that pytorch>=1.5 improves in-place modification detection for optimizers https://github.com/pytorch/pytorch/issues/39141#issuecomment-636881953. This seems to be catching a small bug in the rlkit version pointed to by git reset --hard f136e140a57078c4f0f665051df74dffb1351f33
, in file rlkit/torch/sac/sac.py
:
139 self.qf2_optimizer.zero_grad()
140 qf2_loss.backward()
141 self.qf2_optimizer.step() # <-- updates critic weights
142
143 self.policy_optimizer.zero_grad()
144 policy_loss.backward() # needs original critic weights to backprop, causes RuntimeError in pytorch>=1.5
145 self.policy_optimizer.step()
Switching to pytorch 1.4 makes the error go away, but will not fix this bug. I solved the problem by re-ordering the updates and the loss computation.
@ nitishsrivastava do you issue a pull request on the fix?
Hi,
I went through the steps as indicated on the README of the main page and wanted to run an experiment using
python scripts/train.py
. This error also seems to pop up when I use the--variant
flag and try other specific configurations. Attached is the log printed to the stdout. A large JSON is printed out which I think is fine since that should be the configuration of the experiment that's run, but at the end I get the following message:I haven't made any changes to the directory structure or code except move
utils
toscripts
to make the training script work. I'm also very new to PyTorch so I'm not sure if the error message hints at something wrong with my configuration or with the logic of the code. Any help would be appreciated! For reference, I'm running this on an Ubuntu 20.04 machine.rb_bench_errormessage.txt