File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -65,9 +65,9 @@ def testVariablesSetDevice(self):
65
65
inception .inception_resnet_v2 (inputs , num_classes )
66
66
with tf .variable_scope ('on_gpu' ), tf .device ('/gpu:0' ):
67
67
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' ):
69
69
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' ):
71
71
self .assertDeviceEqual (v .device , '/gpu:0' )
72
72
73
73
def testHalfSizeImages (self ):
Original file line number Diff line number Diff line change @@ -146,9 +146,9 @@ def testVariablesSetDevice(self):
146
146
inception .inception_v4 (inputs , num_classes )
147
147
with tf .variable_scope ('on_gpu' ), tf .device ('/gpu:0' ):
148
148
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' ):
150
150
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' ):
152
152
self .assertDeviceEqual (v .device , '/gpu:0' )
153
153
154
154
def testHalfSizeImages (self ):
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ def main(unused_argv):
196
196
print 'Constructing saver.'
197
197
# Make saver.
198
198
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 )
200
200
201
201
# Make training session.
202
202
sess = tf .InteractiveSession ()
You can’t perform that action at this time.
0 commit comments