Skip to content

Commit 211ee00

Browse files
committed
Convert tf.GraphKeys.VARIABLES -> tf.GraphKeys.GLOBAL_VARIABLES
1 parent 5978a4a commit 211ee00

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

slim/nets/inception_resnet_v2_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ def testVariablesSetDevice(self):
6565
inception.inception_resnet_v2(inputs, num_classes)
6666
with tf.variable_scope('on_gpu'), tf.device('/gpu:0'):
6767
inception.inception_resnet_v2(inputs, num_classes)
68-
for v in tf.get_collection(tf.GraphKeys.VARIABLES, scope='on_cpu'):
68+
for v in tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope='on_cpu'):
6969
self.assertDeviceEqual(v.device, '/cpu:0')
70-
for v in tf.get_collection(tf.GraphKeys.VARIABLES, scope='on_gpu'):
70+
for v in tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope='on_gpu'):
7171
self.assertDeviceEqual(v.device, '/gpu:0')
7272

7373
def testHalfSizeImages(self):

slim/nets/inception_v4_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ def testVariablesSetDevice(self):
146146
inception.inception_v4(inputs, num_classes)
147147
with tf.variable_scope('on_gpu'), tf.device('/gpu:0'):
148148
inception.inception_v4(inputs, num_classes)
149-
for v in tf.get_collection(tf.GraphKeys.VARIABLES, scope='on_cpu'):
149+
for v in tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope='on_cpu'):
150150
self.assertDeviceEqual(v.device, '/cpu:0')
151-
for v in tf.get_collection(tf.GraphKeys.VARIABLES, scope='on_gpu'):
151+
for v in tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope='on_gpu'):
152152
self.assertDeviceEqual(v.device, '/gpu:0')
153153

154154
def testHalfSizeImages(self):

video_prediction/prediction_train.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def main(unused_argv):
196196
print 'Constructing saver.'
197197
# Make saver.
198198
saver = tf.train.Saver(
199-
tf.get_collection(tf.GraphKeys.VARIABLES), max_to_keep=0)
199+
tf.get_collection(tf.GraphKeys.GLOBAL_VARIABLES), max_to_keep=0)
200200

201201
# Make training session.
202202
sess = tf.InteractiveSession()

0 commit comments

Comments
 (0)