当前位置: 首页>>代码示例>>Python>>正文


Python nasnet.nasnet_large_arg_scope方法代码示例

本文整理汇总了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]) 
开发者ID:leimao,项目名称:DeepLab_v3,代码行数:18,代码来源:nasnet_test.py

示例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. 
开发者ID:ahmetozlu,项目名称:vehicle_counting_tensorflow,代码行数:22,代码来源:faster_rcnn_nas_feature_extractor.py


注:本文中的nets.nasnet.nasnet.nasnet_large_arg_scope方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。