diff --git a/runner/frameworks/rl/sf_framework.py b/runner/frameworks/rl/sf_framework.py index b7942135..b27a58ae 100644 --- a/runner/frameworks/rl/sf_framework.py +++ b/runner/frameworks/rl/sf_framework.py @@ -3,6 +3,7 @@ import os import warnings from argparse import Namespace +from pathlib import Path from typing import Any, Dict, Optional # from retinal_rl.rl.sample_factory.observer import RetinalAlgoObserver @@ -68,6 +69,13 @@ def train( ) # Run simulation if not (self.sf_cfg.dry_run): + # HACK: Create the directory for the vizdoom logs, before vizdoom tries to do it: + # Else envs will interfere in the creation process and crash, causing RolloutWorkers + # to stop and thus the whole training to abort. + (Path(self.cfg.path.run_dir) / "_vizdoom").mkdir( + parents=True, exist_ok=True + ) + cfg, runner = make_runner(self.sf_cfg) # if cfg.online_analysis: # runner.register_observer(RetinalAlgoObserver(self.sf_cfg))