Commit 5b856252 authored by Victor Bourgin's avatar Victor Bourgin Committed by Facebook GitHub Bot
Browse files

Deterministic D2GO Trainer Params

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/677

Previously, cfg.SOLVER.DETERMINISTIC was not taken into account for lightning `Trainer` in d2go:
- Nested checks `hasattr(cfg, "SOLVER.DETERMINISTIC")` do not work as expected
- If SOLVER.DETERMINISTIC exists, we should check that it is set to `True`

Reviewed By: ayushidalmia, rbasch

Differential Revision: D63426319

fbshipit-source-id: 8caf0af53e7b97a49392df09153e26ee3628231f
parent 7739077a
......@@ -108,7 +108,11 @@ def get_trainer_params(cfg: CfgNode) -> Dict[str, Any]:
}
)
if hasattr(cfg, "SOLVER.DETERMINISTIC"):
if (
hasattr(cfg, "SOLVER.DETERMINISTIC")
and hasattr(cfg.SOLVER, "DETERMINISTIC")
and cfg.SOLVER.DETERMINISTIC
):
params.update(
{
"sync_batchnorm": True,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment