idreesshaikh / Autonomous-Driving-in-Carla-using-Deep-Reinforcement-Learning

Deep Reinforcement Learning (PPO) in Autonomous Driving (Carla) [from scratch]
MIT License
300 stars 64 forks source link

Why can't agents train using gpu? #7

Closed heyoupeng819 closed 1 year ago

heyoupeng819 commented 1 year ago

I see the torch. device ('cpu ') in your code. I tried to modify it to torch. device ('cuda: 0'), but it doesn't seem to work. my torch.cuda.is_ available() returns true.

idreesshaikh commented 1 year ago

You can definitely change it to gpu, but then you've to change couple of things in algorithm to process everything on gpu. As I understand what you're facing is device inconsistency since half of the processing is done on gpu and half on cpu.