From 91b10857d81750803a9f519cfa7c309f3c2a483d Mon Sep 17 00:00:00 2001 From: MironencoMircea Date: Wed, 28 Jun 2017 15:48:45 +0200 Subject: [PATCH] Fixed TF graph variables deprecation --- baselines/common/tf_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/baselines/common/tf_util.py b/baselines/common/tf_util.py index 0d1df89..3472eb8 100644 --- a/baselines/common/tf_util.py +++ b/baselines/common/tf_util.py @@ -526,7 +526,7 @@ class Module(object): @property def variables(self): assert self.scope is not None, "need to call module once before getting variables" - return tf.get_collection(tf.GraphKeys.VARIABLES, self.scope) + return tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, self.scope) def module(name): @@ -681,7 +681,7 @@ def scope_vars(scope, trainable_only=False): list of variables in `scope`. """ return tf.get_collection( - tf.GraphKeys.TRAINABLE_VARIABLES if trainable_only else tf.GraphKeys.VARIABLES, + tf.GraphKeys.TRAINABLE_VARIABLES if trainable_only else tf.GraphKeys.GLOBAL_VARIABLES, scope=scope if isinstance(scope, str) else scope.name )