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


Python pnasnet.mobile_imagenet_config方法代码示例

本文整理汇总了Python中nets.nasnet.pnasnet.mobile_imagenet_config方法的典型用法代码示例。如果您正苦于以下问题:Python pnasnet.mobile_imagenet_config方法的具体用法?Python pnasnet.mobile_imagenet_config怎么用?Python pnasnet.mobile_imagenet_config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nets.nasnet.pnasnet的用法示例。


在下文中一共展示了pnasnet.mobile_imagenet_config方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testNoAuxHeadMobileModel

# 需要导入模块: from nets.nasnet import pnasnet [as 别名]
# 或者: from nets.nasnet.pnasnet import mobile_imagenet_config [as 别名]
def testNoAuxHeadMobileModel(self):
    batch_size = 5
    height, width = 224, 224
    num_classes = 1000
    for use_aux_head in (True, False):
      tf.reset_default_graph()
      inputs = tf.random_uniform((batch_size, height, width, 3))
      tf.train.create_global_step()
      config = pnasnet.mobile_imagenet_config()
      config.set_hparam('use_aux_head', int(use_aux_head))
      with slim.arg_scope(pnasnet.pnasnet_mobile_arg_scope()):
        _, end_points = pnasnet.build_pnasnet_mobile(
            inputs, num_classes, config=config)
      self.assertEqual('AuxLogits' in end_points, use_aux_head) 
开发者ID:leimao,项目名称:DeepLab_v3,代码行数:16,代码来源:pnasnet_test.py

示例2: testOverrideHParamsMobileModel

# 需要导入模块: from nets.nasnet import pnasnet [as 别名]
# 或者: from nets.nasnet.pnasnet import mobile_imagenet_config [as 别名]
def testOverrideHParamsMobileModel(self):
    batch_size = 5
    height, width = 224, 224
    num_classes = 1000
    inputs = tf.random_uniform((batch_size, height, width, 3))
    tf.train.create_global_step()
    config = pnasnet.mobile_imagenet_config()
    config.set_hparam('data_format', 'NCHW')
    with slim.arg_scope(pnasnet.pnasnet_mobile_arg_scope()):
      _, end_points = pnasnet.build_pnasnet_mobile(
          inputs, num_classes, config=config)
    self.assertListEqual(end_points['Stem'].shape.as_list(),
                         [batch_size, 135, 28, 28]) 
开发者ID:leimao,项目名称:DeepLab_v3,代码行数:15,代码来源:pnasnet_test.py

示例3: testUseBoundedAcitvationMobileModel

# 需要导入模块: from nets.nasnet import pnasnet [as 别名]
# 或者: from nets.nasnet.pnasnet import mobile_imagenet_config [as 别名]
def testUseBoundedAcitvationMobileModel(self):
    batch_size = 1
    height, width = 224, 224
    num_classes = 1000
    for use_bounded_activation in (True, False):
      tf.reset_default_graph()
      inputs = tf.random_uniform((batch_size, height, width, 3))
      config = pnasnet.mobile_imagenet_config()
      config.set_hparam('use_bounded_activation', use_bounded_activation)
      with slim.arg_scope(pnasnet.pnasnet_mobile_arg_scope()):
        _, _ = pnasnet.build_pnasnet_mobile(
            inputs, num_classes, config=config)
      for node in tf.get_default_graph().as_graph_def().node:
        if node.op.startswith('Relu'):
          self.assertEqual(node.op == 'Relu6', use_bounded_activation) 
开发者ID:IBM,项目名称:MAX-Image-Segmenter,代码行数:17,代码来源:pnasnet_test.py

示例4: testNoAuxHeadMobileModel

# 需要导入模块: from nets.nasnet import pnasnet [as 别名]
# 或者: from nets.nasnet.pnasnet import mobile_imagenet_config [as 别名]
def testNoAuxHeadMobileModel(self):
    batch_size = 5
    height, width = 224, 224
    num_classes = 1000
    for use_aux_head in (True, False):
      tf.reset_default_graph()
      inputs = tf.random.uniform((batch_size, height, width, 3))
      tf.train.create_global_step()
      config = pnasnet.mobile_imagenet_config()
      config.set_hparam('use_aux_head', int(use_aux_head))
      with slim.arg_scope(pnasnet.pnasnet_mobile_arg_scope()):
        _, end_points = pnasnet.build_pnasnet_mobile(
            inputs, num_classes, config=config)
      self.assertEqual('AuxLogits' in end_points, use_aux_head) 
开发者ID:tensorflow,项目名称:models,代码行数:16,代码来源:pnasnet_test.py

示例5: testOverrideHParamsMobileModel

# 需要导入模块: from nets.nasnet import pnasnet [as 别名]
# 或者: from nets.nasnet.pnasnet import mobile_imagenet_config [as 别名]
def testOverrideHParamsMobileModel(self):
    batch_size = 5
    height, width = 224, 224
    num_classes = 1000
    inputs = tf.random.uniform((batch_size, height, width, 3))
    tf.train.create_global_step()
    config = pnasnet.mobile_imagenet_config()
    config.set_hparam('data_format', 'NCHW')
    with slim.arg_scope(pnasnet.pnasnet_mobile_arg_scope()):
      _, end_points = pnasnet.build_pnasnet_mobile(
          inputs, num_classes, config=config)
    self.assertListEqual(end_points['Stem'].shape.as_list(),
                         [batch_size, 135, 28, 28]) 
开发者ID:tensorflow,项目名称:models,代码行数:15,代码来源:pnasnet_test.py

示例6: testUseBoundedAcitvationMobileModel

# 需要导入模块: from nets.nasnet import pnasnet [as 别名]
# 或者: from nets.nasnet.pnasnet import mobile_imagenet_config [as 别名]
def testUseBoundedAcitvationMobileModel(self):
    batch_size = 1
    height, width = 224, 224
    num_classes = 1000
    for use_bounded_activation in (True, False):
      tf.reset_default_graph()
      inputs = tf.random.uniform((batch_size, height, width, 3))
      config = pnasnet.mobile_imagenet_config()
      config.set_hparam('use_bounded_activation', use_bounded_activation)
      with slim.arg_scope(pnasnet.pnasnet_mobile_arg_scope()):
        _, _ = pnasnet.build_pnasnet_mobile(
            inputs, num_classes, config=config)
      for node in tf.get_default_graph().as_graph_def().node:
        if node.op.startswith('Relu'):
          self.assertEqual(node.op == 'Relu6', use_bounded_activation) 
开发者ID:tensorflow,项目名称:models,代码行数:17,代码来源:pnasnet_test.py


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