diff --git a/com.unity.ml-agents/CHANGELOG.md b/com.unity.ml-agents/CHANGELOG.md index f2f8956dfb..183134757f 100755 --- a/com.unity.ml-agents/CHANGELOG.md +++ b/com.unity.ml-agents/CHANGELOG.md @@ -68,6 +68,9 @@ or actuators on your system. (#5194) - Removed additional memory allocations that were occurring due to assert messages and iterating of DemonstrationRecorders. (#5246) - Fixed a bug where agent trying to access unintialized fields when creating a new RayPerceptionSensorComponent on an agent. (#5261) +#### ml-agents / ml-agents-envs / gym-unity (Python) +- Fixed a bug where --results-dir has no effect. (#5269) + ## [1.9.1-preview] - 2021-04-13 ### Major Changes #### ml-agents / ml-agents-envs / gym-unity (Python) diff --git a/ml-agents/mlagents/trainers/cli_utils.py b/ml-agents/mlagents/trainers/cli_utils.py index fcb8b14b89..2cd36eb1f9 100644 --- a/ml-agents/mlagents/trainers/cli_utils.py +++ b/ml-agents/mlagents/trainers/cli_utils.py @@ -190,7 +190,10 @@ def _create_parser() -> argparse.ArgumentParser: help="(Removed) Use the TensorFlow framework.", ) argparser.add_argument( - "--results-dir", default="results", help="Results base directory" + "--results-dir", + default="results", + action=DetectDefault, + help="Results base directory", ) eng_conf = argparser.add_argument_group(title="Engine Configuration") diff --git a/ml-agents/mlagents/trainers/tests/test_learn.py b/ml-agents/mlagents/trainers/tests/test_learn.py index 54783b41ff..68efb64adb 100644 --- a/ml-agents/mlagents/trainers/tests/test_learn.py +++ b/ml-agents/mlagents/trainers/tests/test_learn.py @@ -187,6 +187,7 @@ def test_yaml_args(mock_file): "--num-envs=2", "--no-graphics", "--debug", + "--results-dir=myresults", ] opt = parse_command_line(full_args) @@ -200,6 +201,7 @@ def test_yaml_args(mock_file): assert opt.debug is True assert opt.checkpoint_settings.inference is True assert opt.checkpoint_settings.resume is True + assert opt.checkpoint_settings.results_dir == "myresults" @patch("builtins.open", new_callable=mock_open, read_data=MOCK_YAML)