From cf90394a091648eb29a74f5c35e0f11b7aeaf99d Mon Sep 17 00:00:00 2001 From: Eric Liang Date: Sat, 7 Sep 2019 12:10:03 -0700 Subject: [PATCH] [rllib] Fix TF2 import of EagerVariableStore (#5625) --- rllib/agents/dqn/distributional_q_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rllib/agents/dqn/distributional_q_model.py b/rllib/agents/dqn/distributional_q_model.py index d76014e88..4e9e4143a 100644 --- a/rllib/agents/dqn/distributional_q_model.py +++ b/rllib/agents/dqn/distributional_q_model.py @@ -152,9 +152,9 @@ class DistributionalQModel(TFModelV2): return state_score if tf.executing_eagerly(): + from tensorflow.python.ops import variable_scope # Have to use a variable store to reuse variables in eager mode - import tensorflow.contrib as tfc - store = tfc.eager.EagerVariableStore() + store = variable_scope.EagerVariableStore() # Save the scope objects, since in eager we will execute this # path repeatedly and there is no guarantee it will always be run