Skip to content

Commit

Permalink
Fix vector env deletion (facebookresearch#185)
Browse files Browse the repository at this point in the history
Explicitly call close for vector env to avoid issues with file writer prematurely close buffer when tensorboard enabled. See facebookresearch#184 for more info.
  • Loading branch information
JasonJiazhiZhang authored and mathfac committed Aug 15, 2019
1 parent e949db7 commit 92d9e6d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions habitat_baselines/rl/ppo/ppo_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ def train(self) -> None:
self.save_checkpoint(f"ckpt.{count_checkpoints}.pth")
count_checkpoints += 1

self.envs.close()

def _eval_checkpoint(
self,
checkpoint_path: str,
Expand Down Expand Up @@ -554,3 +556,5 @@ def _eval_checkpoint(
{"average success": episode_success_mean},
checkpoint_index,
)

self.envs.close()

0 comments on commit 92d9e6d

Please sign in to comment.