本文整理匯總了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'))