From 946ebfaa3c5442927595c9fe6d03bf7f8a83191a Mon Sep 17 00:00:00 2001 From: Ashwinee Panda Date: Wed, 11 Sep 2019 14:35:42 -0700 Subject: [PATCH] [rllib] Validate that entropy coeff is not an integer (#5687) * Validate that entropy coeff is not an integer Passing an integer value for entropy coeff such as 0 raises an error somewhere inside the TF policy graph, so this checks to make sure the entropy coeff is a float. * Cast to float instead Also move this check after the negative value check --- rllib/agents/ppo/ppo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rllib/agents/ppo/ppo.py b/rllib/agents/ppo/ppo.py index 3df44b412..828402603 100644 --- a/rllib/agents/ppo/ppo.py +++ b/rllib/agents/ppo/ppo.py @@ -129,6 +129,8 @@ def warn_about_bad_reward_scales(trainer, result): def validate_config(config): if config["entropy_coeff"] < 0: raise DeprecationWarning("entropy_coeff must be >= 0") + if isinstance(config["entropy_coeff"], int): + config["entropy_coeff"] = float(config["entropy_coeff"]) if config["sgd_minibatch_size"] > config["train_batch_size"]: raise ValueError( "Minibatch size {} must be <= train batch size {}.".format(