vita-epfl / CrowdNav

[ICRA19] Crowd-aware Robot Navigation with Attention-based Deep Reinforcement Learning
MIT License
601 stars 172 forks source link

training issue #49

Open ShelyH opened 2 years ago

ShelyH commented 2 years ago

Hi,sorry to bother you. I don't want to imitate learning,so I set 'imitation_learning=False' in train.py,but there are some error: AttributeError: 'JointState' object has no attribute 'unsqueeze' File "train.py", line 188, in main() File "train.py", line 140, in main explorer.run_k_episodes(il_episodes, 'train', update_memory=True, imitation_learning=False) File "../crowd_nav/utils/explorer.py", line 72, in run_k_episodes self.update_memory(states, actions, rewards, imitation_learning) File "../crowd_nav/utils/explorer.py", line 116, in update_memory value = reward + gamma_bar * self.target_model(next_state.unsqueeze(0)).data.item() AttributeError: 'JointState' object has no attribute 'unsqueeze'

Can you tell me how to solve it?Thanks very much!

ChanganVR commented 2 years ago

@2529342549 if you don't want to run imitation learning, you should comment out these lines altogether instead of just setting that variable to False: https://github.com/vita-epfl/CrowdNav/blob/20d678085c06831e658a65b9e20c8bb6f6ecdc10/crowd_nav/train.py#L116-L133

Let me know if this fix works for you.

ShelyH commented 2 years ago

Hi, thanks for your last answer,I'm here to disturb you again。 During training, the model is evaluated every 1000 intervals,the purpose of this is to show how good or bad the current model is or if there are other intentions? # evaluate the model if episode % evaluation_interval == 0: explorer.run_k_episodes(env.case_size['val'], 'val', episode=episode)