p-christ/Deep-Reinforcement-Learning-Algorithms-with-PyTorch

Device problem for DDQN

ierezell opened this issue · 0 comments

It's just to help improve this wondeful repo (so useful to test differents agents)

I got some troubles with devices training in a custom environement.

L.42 in BaseAgent, I replaced :
self.device = "cuda:0" if torch.cuda.is_available() else "cpu"
by :
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

Now it works like a charm ! I don't know if it was a bug a feature or just some weird config I had but I guess the second option is more general.

Thanks a lot for all your repo