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.32k stars 461 forks source link

Failed to run evaluation phase with gym environment "FetchReach-v1" and DDPG agent #294

Closed Altriaex closed 5 years ago

Altriaex commented 5 years ago

Hi, I was trying to run DDPG agent on "FetchReach-v1" of openai Gym, but I got the following error.

Could you please tell me how to fix it?

agent: Starting evaluation phase Creating window glfw

TypeError Traceback (most recent call last)

in 14 graph_manager.create_graph(task_parameters) 15 ---> 16 graph_manager.improve() ~/Project/coach-tutorials/coach-master/rl_coach/graph_managers/graph_manager.py in improve(self) 548 while self.total_steps_counters[RunPhase.TRAIN] < count_end: 549 self.train_and_act(self.steps_between_evaluation_periods) --> 550 if self.evaluate(self.evaluation_steps): 551 break 552 ~/Project/coach-tutorials/coach-master/rl_coach/graph_managers/graph_manager.py in evaluate(self, steps) 509 count_end = self.current_step_counter + steps 510 while self.current_step_counter < count_end: --> 511 self.act(EnvironmentEpisodes(1)) 512 self.sync() 513 if self.should_stop(): ~/Project/coach-tutorials/coach-master/rl_coach/graph_managers/graph_manager.py in act(self, steps, wait_for_full_episodes) 447 448 steps_begin = self.environments[0].total_steps_counter --> 449 result = self.top_level_manager.step(None) 450 steps_end = self.environments[0].total_steps_counter 451 ~/Project/coach-tutorials/coach-master/rl_coach/level_manager.py in step(self, action) 248 if action_info: 249 # step environment --> 250 env_response = self.environment.step(action_info.action) 251 252 # accumulate rewards such that the master policy will see the total reward during the step phase ~/Project/coach-tutorials/coach-master/rl_coach/environments/environment.py in step(self, action) 322 if self.should_dump_video_of_the_current_episode(episode_terminated=False) and \ 323 (self.visualization_parameters.dump_mp4 or self.visualization_parameters.dump_gifs): --> 324 self.last_episode_images.append(self.get_rendered_image()) 325 326 return self.last_env_response ~/Project/coach-tutorials/coach-master/rl_coach/environments/gym_environment.py in get_rendered_image(self) 512 if self.is_robotics_env: 513 # necessary for fetch since the rendered image is cropped to an irrelevant part of the simulator --> 514 image = self._get_robotics_image() 515 else: 516 image = self.env.render(mode='rgb_array') ~/Project/coach-tutorials/coach-master/rl_coach/environments/gym_environment.py in _get_robotics_image(self) 499 def _get_robotics_image(self): 500 self.env.render() --> 501 image = self.env.unwrapped._get_viewer().read_pixels(1600, 900, depth=False)[::-1, :, :] 502 image = scipy.misc.imresize(image, (270, 480, 3)) 503 return image TypeError: _get_viewer() missing 1 required positional argument: 'mode'
gal-leibovich commented 5 years ago

Hi,

297 should resolve the issue.

gal-leibovich commented 5 years ago

Closing. Please reopen if problem persists.