本文整理汇总了Python中inception.slim.variables.get_variables_to_restore方法的典型用法代码示例。如果您正苦于以下问题:Python variables.get_variables_to_restore方法的具体用法?Python variables.get_variables_to_restore怎么用?Python variables.get_variables_to_restore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类inception.slim.variables
的用法示例。
在下文中一共展示了variables.get_variables_to_restore方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testGetVariablesToRestore
# 需要导入模块: from inception.slim import variables [as 别名]
# 或者: from inception.slim.variables import get_variables_to_restore [as 别名]
def testGetVariablesToRestore(self):
with self.test_session():
with tf.variable_scope('A'):
a = variables.variable('a', [5])
with tf.variable_scope('B'):
b = variables.variable('a', [5])
self.assertEquals([a, b], variables.get_variables_to_restore())
示例2: testNoneGetVariablesToRestore
# 需要导入模块: from inception.slim import variables [as 别名]
# 或者: from inception.slim.variables import get_variables_to_restore [as 别名]
def testNoneGetVariablesToRestore(self):
with self.test_session():
with tf.variable_scope('A'):
a = variables.variable('a', [5], restore=False)
with tf.variable_scope('B'):
b = variables.variable('a', [5], restore=False)
self.assertEquals([], variables.get_variables_to_restore())
self.assertEquals([a, b], variables.get_variables())
示例3: testGetMixedVariablesToRestore
# 需要导入模块: from inception.slim import variables [as 别名]
# 或者: from inception.slim.variables import get_variables_to_restore [as 别名]
def testGetMixedVariablesToRestore(self):
with self.test_session():
with tf.variable_scope('A'):
a = variables.variable('a', [5])
b = variables.variable('b', [5], restore=False)
with tf.variable_scope('B'):
c = variables.variable('c', [5])
d = variables.variable('d', [5], restore=False)
self.assertEquals([a, b, c, d], variables.get_variables())
self.assertEquals([a, c], variables.get_variables_to_restore())
示例4: testVariableRestoreWithArgScopeNested
# 需要导入模块: from inception.slim import variables [as 别名]
# 或者: from inception.slim.variables import get_variables_to_restore [as 别名]
def testVariableRestoreWithArgScopeNested(self):
with self.test_session():
with scopes.arg_scope([variables.variable], restore=True):
a = variables.variable('a', [])
with scopes.arg_scope([variables.variable],
trainable=False,
collections=['A', 'B']):
b = variables.variable('b', [])
c = variables.variable('c', [])
self.assertListEqual([a, b, c], variables.get_variables_to_restore())
self.assertListEqual([a, c], tf.trainable_variables())
self.assertListEqual([b], tf.get_collection('A'))
self.assertListEqual([b], tf.get_collection('B'))