From bbe3e5b4edfb68e555a80710ddad73f80d44fce7 Mon Sep 17 00:00:00 2001 From: Philipp Moritz Date: Tue, 25 Jun 2019 22:06:36 -0700 Subject: [PATCH] [rllib] Give error if sample_async is used with pytorch for A3C (#5000) * give error if sample_async is used with pytorch * update * Update a3c.py --- python/ray/rllib/agents/a3c/a3c.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/ray/rllib/agents/a3c/a3c.py b/python/ray/rllib/agents/a3c/a3c.py index c269df2fc..d320b9636 100644 --- a/python/ray/rllib/agents/a3c/a3c.py +++ b/python/ray/rllib/agents/a3c/a3c.py @@ -48,6 +48,10 @@ def get_policy_class(config): def validate_config(config): if config["entropy_coeff"] < 0: raise DeprecationWarning("entropy_coeff must be >= 0") + if config["sample_async"] and config["use_pytorch"]: + raise ValueError( + "The sample_async option is not supported with use_pytorch: " + "Multithreading can be lead to crashes if used with pytorch.") def make_async_optimizer(workers, config):