From 20ea85c1a0d6aeaf1e55e9d80794176cfd1c3b94 Mon Sep 17 00:00:00 2001 From: Andrew Cohen Date: Wed, 8 Jul 2020 17:16:58 -0700 Subject: [PATCH 1/5] add warning if behavior name not found in trainer config --- ml-agents/mlagents/trainers/trainer_util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ml-agents/mlagents/trainers/trainer_util.py b/ml-agents/mlagents/trainers/trainer_util.py index 01fe654dbc..65d6a2e7fc 100644 --- a/ml-agents/mlagents/trainers/trainer_util.py +++ b/ml-agents/mlagents/trainers/trainer_util.py @@ -39,6 +39,10 @@ def __init__( self.ghost_controller = GhostController() def generate(self, brain_name: str) -> Trainer: + if brain_name not in self.trainer_config.keys(): + logger.warning( + f"Behavior name {brain_name} does not match any behaviors in the trainer configuration file. " + ) return initialize_trainer( self.trainer_config[brain_name], brain_name, From 9e0edc964fd6249ab63072be165e53b47c68bd5f Mon Sep 17 00:00:00 2001 From: Andrew Cohen Date: Wed, 8 Jul 2020 17:19:34 -0700 Subject: [PATCH 2/5] remove ws --- ml-agents/mlagents/trainers/trainer_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ml-agents/mlagents/trainers/trainer_util.py b/ml-agents/mlagents/trainers/trainer_util.py index 65d6a2e7fc..82ae83c896 100644 --- a/ml-agents/mlagents/trainers/trainer_util.py +++ b/ml-agents/mlagents/trainers/trainer_util.py @@ -41,7 +41,7 @@ def __init__( def generate(self, brain_name: str) -> Trainer: if brain_name not in self.trainer_config.keys(): logger.warning( - f"Behavior name {brain_name} does not match any behaviors in the trainer configuration file. " + f"Behavior name {brain_name} does not match any behaviors in the trainer configuration file." ) return initialize_trainer( self.trainer_config[brain_name], From dd7ff8e2830c854c97d41b56a06f367a28111233 Mon Sep 17 00:00:00 2001 From: andrewcoh <54679309+andrewcoh@users.noreply.github.com> Date: Wed, 8 Jul 2020 17:23:23 -0700 Subject: [PATCH 3/5] Update ml-agents/mlagents/trainers/trainer_util.py Co-authored-by: Ervin T. --- ml-agents/mlagents/trainers/trainer_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ml-agents/mlagents/trainers/trainer_util.py b/ml-agents/mlagents/trainers/trainer_util.py index 82ae83c896..758cb8a27f 100644 --- a/ml-agents/mlagents/trainers/trainer_util.py +++ b/ml-agents/mlagents/trainers/trainer_util.py @@ -41,7 +41,7 @@ def __init__( def generate(self, brain_name: str) -> Trainer: if brain_name not in self.trainer_config.keys(): logger.warning( - f"Behavior name {brain_name} does not match any behaviors in the trainer configuration file." + f"Behavior name {brain_name} does not match any behaviors specified in the trainer configuration file." ) return initialize_trainer( self.trainer_config[brain_name], From 8ec5e8c06e664213e7de41a06a1d30e24c168742 Mon Sep 17 00:00:00 2001 From: andrewcoh <54679309+andrewcoh@users.noreply.github.com> Date: Thu, 9 Jul 2020 09:58:51 -0700 Subject: [PATCH 4/5] Print all behaviors in yaml Co-authored-by: Chris Elion --- ml-agents/mlagents/trainers/trainer_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ml-agents/mlagents/trainers/trainer_util.py b/ml-agents/mlagents/trainers/trainer_util.py index 758cb8a27f..d1e37daf2c 100644 --- a/ml-agents/mlagents/trainers/trainer_util.py +++ b/ml-agents/mlagents/trainers/trainer_util.py @@ -41,7 +41,7 @@ def __init__( def generate(self, brain_name: str) -> Trainer: if brain_name not in self.trainer_config.keys(): logger.warning( - f"Behavior name {brain_name} does not match any behaviors specified in the trainer configuration file." + f"Behavior name {brain_name} does not match any behaviors specified in the trainer configuration file: {sorted(self.trainer_config.keys())}" ) return initialize_trainer( self.trainer_config[brain_name], From f7dbef9ff0928c7666d3194e4622fd75dc090027 Mon Sep 17 00:00:00 2001 From: Andrew Cohen Date: Thu, 9 Jul 2020 10:14:48 -0700 Subject: [PATCH 5/5] fix precommit error --- ml-agents/mlagents/trainers/trainer_util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ml-agents/mlagents/trainers/trainer_util.py b/ml-agents/mlagents/trainers/trainer_util.py index d1e37daf2c..e788bf56ce 100644 --- a/ml-agents/mlagents/trainers/trainer_util.py +++ b/ml-agents/mlagents/trainers/trainer_util.py @@ -41,7 +41,8 @@ def __init__( def generate(self, brain_name: str) -> Trainer: if brain_name not in self.trainer_config.keys(): logger.warning( - f"Behavior name {brain_name} does not match any behaviors specified in the trainer configuration file: {sorted(self.trainer_config.keys())}" + f"Behavior name {brain_name} does not match any behaviors specified in the trainer configuration file:" + f"{sorted(self.trainer_config.keys())}" ) return initialize_trainer( self.trainer_config[brain_name],