Skip to content

Commit

Permalink
Make make_environment Monitor and VideoRecorder compatible with dry-run
Browse files Browse the repository at this point in the history
  • Loading branch information
sharif1093 committed Jun 20, 2019
1 parent 05fd8f6 commit 19e33bf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions digideep/environment/make_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,17 @@ def _f():
## Add monitoring wrappers (not optional).
if not force_no_monitor:
log_dir = os.path.join(self.session["path_monitor"], str(rank))
env = Monitor(env, log_dir, **self.params["main_wrappers"]["Monitor"])
if not self.session.dry_run:
env = Monitor(env, log_dir, **self.params["main_wrappers"]["Monitor"])
else:
env = Monitor(env, "/tmp", **self.params["main_wrappers"]["Monitor"])


## Add a video recorder if mode == "eval".
if self.mode == "eval":
if self.mode == "eval" and not self.session.dry_run:
videos_dir = os.path.join(self.session["path_videos"], str(rank))
env = MonitorVideoRecorder(env, videos_dir, video_callable=lambda id:True)


## Dummy Dict Action and Observation
if not isinstance(env.action_space, spaces.Dict):
Expand Down

0 comments on commit 19e33bf

Please sign in to comment.