From 90b758f7250239f353a046c9ef488ac8f17ecba1 Mon Sep 17 00:00:00 2001 From: Jeremy Reizenstein Date: Wed, 7 Sep 2022 03:25:39 -0700 Subject: [PATCH] hydra fix Summary: Workaround for oddity with new hydra. Reviewed By: davnov134 Differential Revision: D39280639 fbshipit-source-id: 76e91947f633589945446db93cf2dbc259642f8a --- projects/implicitron_trainer/experiment.py | 4 ++++ projects/implicitron_trainer/tests/experiment.yaml | 1 + 2 files changed, 5 insertions(+) diff --git a/projects/implicitron_trainer/experiment.py b/projects/implicitron_trainer/experiment.py index c042e965b..a033251a6 100755 --- a/projects/implicitron_trainer/experiment.py +++ b/projects/implicitron_trainer/experiment.py @@ -83,6 +83,9 @@ logger = logging.getLogger(__name__) +# workaround for https://github.com/facebookresearch/hydra/issues/2262 +_RUN = hydra.types.RunMode.RUN + if version.parse(hydra.__version__) < version.Version("1.1"): raise ValueError( f"Hydra version {hydra.__version__} is too old." @@ -136,6 +139,7 @@ class Experiment(Configurable): # pyre-ignore: 13 default_factory=lambda: { "run": {"dir": "."}, # Make hydra not change the working dir. "output_subdir": None, # disable storing the .hydra logs + "mode": _RUN, } ) diff --git a/projects/implicitron_trainer/tests/experiment.yaml b/projects/implicitron_trainer/tests/experiment.yaml index 976027ca1..9588043b8 100644 --- a/projects/implicitron_trainer/tests/experiment.yaml +++ b/projects/implicitron_trainer/tests/experiment.yaml @@ -9,6 +9,7 @@ hydra: run: dir: . output_subdir: null + mode: RUN data_source_ImplicitronDataSource_args: dataset_map_provider_class_type: ??? data_loader_map_provider_class_type: SequenceDataLoaderMapProvider