m-hasan-n / pooling

"Pooling Toolbox" is the code of our work "Maneuver-Aware Pooling for Vehicle Trajectory Prediction".
MIT License
50 stars 8 forks source link

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! #4

Open BingY998 opened 10 months ago

BingY998 commented 10 months ago

Hello,thanks for your wonderful work! When I was training, near the end of the sixth epochs, this error occurred. Is there a solution for this? image

harryguantj commented 7 months ago

Try to use "print(x.device)" to determine which device the variable 'x' belongs to. This error occurs because the variable 'acc' and 'out' belongs to the CPU rather than cuda:0.