IntelLabs / coach

Reinforcement Learning Coach by Intel AI Lab enables easy experimentation with state of the art Reinforcement Learning algorithms
https://intellabs.github.io/coach/
Apache License 2.0
2.33k stars 461 forks source link

Error with Vizdoom #69

Closed nina124 closed 6 years ago

nina124 commented 6 years ago

It seems there is something wrong with the Vizdoom environment. I try VIZDOOM_ROOT=/home/nina/ViZDoom python3 coach.py -p Doom_Basic_Dueling_DDQN , but receive the following error.

Traceback (most recent call last): File "coach.py", line 271, in env_instance = create_environment(tuning_parameters) File "/home/nina/test/RL/coach/environments/init.py", line 32, in create_environment env = eval(env_type)(tuning_parameters) File "/home/nina/test/RL/coach/environments/doom_environment_wrapper.py", line 132, in init self.reset() File "/home/nina/test/RL/coach/environments/environment_wrapper.py", line 171, in reset self._update_state() File "/home/nina/test/RL/coach/environments/doom_environment_wrapper.py", line 140, in _update_state 'measurements': state.game_variables, File "/home/nina/test/RL/coach/environments/environment_wrapper.py", line 81, in observation assert False AssertionError

RLWJR commented 6 years ago

I'm getting the same thing...... Anyone?

zach-nervana commented 6 years ago

Try replacing self.observation with self.state on line 138 of doom_environment_wrapper.py

If that does it, I'll submit a PR when i get to a computer later.

nina124 commented 6 years ago

hi @zach-nervana , Thanks for your reply. I have modified as you suggested. It started trianing, but the training reward and test reward maintain -300 after one day and a half's training. The running command is VIZDOOM_ROOT=/home/nina/ViZDoom python3 coach.py -p Doom_Basic_Dueling_DDQN -n 16. I tried to play myself to figure out what the '-300 reward' means, with `VIZDOOM_ROOT=/home/nina/ViZDoom python3 coach.py -p Doom_Basic_Dueling_DDQN --play. After given an 'ATTACK' action, it returns the foolowing error:

Traceback (most recent call last): File "coach.py", line 278, in agent.improve() File "/home/nina/test/RL/coach/agents/agent.py", line 551, in improve self.act() File "/home/nina/test/RL/coach/agents/agent.py", line 394, in act result = self.env.step(action) File "/home/nina/test/RL/coach/environments/environment_wrapper.py", line 143, in step self.render() File "/home/nina/test/RL/coach/environments/environment_wrapper.py", line 157, in render self.renderer.render_image(self.get_rendered_image()) File "/home/nina/test/RL/coach/renderer.py", line 44, in render_image if len(image.shape) == 2: AttributeError: 'LazyStack' object has no attribute 'shape'

itaicaspi-intel commented 6 years ago

Thanks @nina124. In the new version of Coach, this should work fine. Try running a single worker using coach -p Doom_Basic_Dueling_DDQN. It should train in several minutes.