reiniscimurs / DRL-robot-navigation

Deep Reinforcement Learning for mobile robot navigation in ROS Gazebo simulator. Using Twin Delayed Deep Deterministic Policy Gradient (TD3) neural network, a robot learns to navigate to a random goal point in a simulated environment while avoiding obstacles.
MIT License
486 stars 97 forks source link

train problem #142

Closed yyydddkkk closed 1 month ago

yyydddkkk commented 1 month ago

Hello, could you help me solve the problem I encountered?

Traceback (most recent call last): File "train_velodyne_td3.py", line 168, in priority = network.to_priority(state,action,reward,done_bool,next_state) File "/root/autodl-tmp/DRL-robot-navigation/TD3/TD3.py", line 57, in to_priority target_Q = reward + self.discount (1 - done) target_Q RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

reiniscimurs commented 1 month ago

Hi,

There is no such code in this repo: priority = network.to_priority(state,action,reward,done_bool,next_state)

But your tensors are located on different devices. Simple Google search will help you solve this problem.