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

RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #4 'mat1'

Jeffrey28 opened this issue · 9 comments

I run the Cart_Pole.py and got the error.

And if I choose “use_GPU" is True. It works well. However, when it ran with A3C, I got the error: Runtime Error: CUDA error (3): initialization error. So, do you have any suggestions for me?

yeah,i have the same problem, when i run python3 results/Cartpole.py

GPU doesn't work with A3C because A3C uses multiprocessing - try turning off the GPU to see if it works. For small games anyway it is faster to run it with the GPU turned off.

@p-christ but when i turn off the gpu. it will display
RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #4 'mat1'

yeah

@p-christ but when i turn off the gpu. it will display
RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #4 'mat1'

yeah, the same problem.

Have you also set: config.use_GPU = False ?

Have you also set: config.use_GPU = False ?

Yeah, I have set.

So got the RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #4 'mat1'

Have you solved this problem yet?I have the same problem when I run results/Cartpole with any agent.