KamyarGh / rl_swiss

MIT License
62 stars 11 forks source link

Error when running the demo #3

Open yuguangyue opened 3 years ago

yuguangyue commented 3 years ago

Hi, I was running the demo code python run_experiment.py --nosrun -e exp_specs/sac.yaml

but get following error, do you have any idea why this happens? Thank you! (I am using pytorch 1.6.0 and python version 3.7.9)

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [32, 1]], which is output 0 of TBackward, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

sjtulyf123 commented 3 years ago

Hello, I overcame the same error. Try to update policy network before updating q1 and q2 and set retain_graph=True and it might work. This error seems to be relevant to the torch or cuda version...

KamyarGh commented 3 years ago

Hi, sorry for missing the original post. I also think maybe this is coming from not using the correct torch version (the conda virtual env specs are given in the .yml file).