SforAiDl / genrl

A PyTorch reinforcement learning library for generalizable and reproducible algorithm implementations with an aim to improve accessibility in RL
https://genrl.readthedocs.io
MIT License
403 stars 59 forks source link

Trainer Evaluate not working #321

Closed Sharad24 closed 3 years ago

Sharad24 commented 4 years ago

Probably as a result of #294

Issue might be that there is a detach().clone() missing somewhere. What ends up happening is that an underlying pointer reference is passes on which later becomes 0. For e.g.

rewards = torch.zeros(10) # Assuming there are 10 envs
rewards[i] = self.env.rewards[i] # This might be incompatible. As a clone operation might be needed.

Similarly for states, actions, etc