[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
This commit is contained in:
Ashwinee Panda
2019-09-11 14:35:42 -07:00
committed by Eric Liang
parent faeaa34bdd
commit 946ebfaa3c
+2
View File
@@ -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(