本文整理匯總了Python中nets.nasnet.nasnet.nasnet_large_arg_scope方法的典型用法代碼示例。如果您正苦於以下問題:Python nasnet.nasnet_large_arg_scope方法的具體用法?Python nasnet.nasnet_large_arg_scope怎麽用?Python nasnet.nasnet_large_arg_scope使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nets.nasnet.nasnet
的用法示例。
在下文中一共展示了nasnet.nasnet_large_arg_scope方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testBuildLogitsLargeModel
# 需要導入模塊: from nets.nasnet import nasnet [as 別名]
# 或者: from nets.nasnet.nasnet import nasnet_large_arg_scope [as 別名]
def testBuildLogitsLargeModel(self):
batch_size = 5
height, width = 331, 331
num_classes = 1000
inputs = tf.random_uniform((batch_size, height, width, 3))
tf.train.create_global_step()
with slim.arg_scope(nasnet.nasnet_large_arg_scope()):
logits, end_points = nasnet.build_nasnet_large(inputs, num_classes)
auxlogits = end_points['AuxLogits']
predictions = end_points['Predictions']
self.assertListEqual(auxlogits.get_shape().as_list(),
[batch_size, num_classes])
self.assertListEqual(logits.get_shape().as_list(),
[batch_size, num_classes])
self.assertListEqual(predictions.get_shape().as_list(),
[batch_size, num_classes])
示例2: nasnet_large_arg_scope_for_detection
# 需要導入模塊: from nets.nasnet import nasnet [as 別名]
# 或者: from nets.nasnet.nasnet import nasnet_large_arg_scope [as 別名]
def nasnet_large_arg_scope_for_detection(is_batch_norm_training=False):
"""Defines the default arg scope for the NASNet-A Large for object detection.
This provides a small edit to switch batch norm training on and off.
Args:
is_batch_norm_training: Boolean indicating whether to train with batch norm.
Returns:
An `arg_scope` to use for the NASNet Large Model.
"""
imagenet_scope = nasnet.nasnet_large_arg_scope()
with arg_scope(imagenet_scope):
with arg_scope([slim.batch_norm], is_training=is_batch_norm_training) as sc:
return sc
# Note: This is largely a copy of _build_nasnet_base inside nasnet.py but
# with special edits to remove instantiation of the stem and the special
# ability to receive as input a pair of hidden states.