eleurent / rl-agents

Implementations of Reinforcement Learning and Planning algorithms
MIT License
582 stars 152 forks source link

Display vehicle attention and distribution of actions only works in episode 0 #96

Closed Karim-SUN closed 1 year ago

Karim-SUN commented 1 year ago

Hi, eleurent. I've tried ego-attention agent in IntersectionEnv and everything worked fine, except that the pygame window only displays attention values and distribution of actions in episode 0 (picture below) 捕获

and after that every time the visualization window shows up and it only displays the environment (like picture below) 捕获1

In debug mode I've noticed the pygame window successfully doubled in width before episode 0 started and close normally after episode is done. After that in episode 1, 8, 27... (when the episode should be displayed accordingly) the pygame window just contains the environment. I assume it has something to do with the agents/deep_q_network/graphics.py in function display, but I don't know how to correct this. Appreciate your help :)

eleurent commented 1 year ago

You are right, this was caused by changes in how gym/gymnasium handles the recording of videos at the end of episodes. This should now be fixed at HEAD, so you need to install the latest version (upgrade rl-agents, uninstall highway-env, clone the repo and pip install .)