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


Python resnet_v2.resnet_v2_101方法代码示例

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


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

示例1: resnet_v2_101

# 需要导入模块: from tensorflow.contrib.slim.nets import resnet_v2 [as 别名]
# 或者: from tensorflow.contrib.slim.nets.resnet_v2 import resnet_v2_101 [as 别名]
def resnet_v2_101(inputs,
                  num_classes=None,
                  is_training=True,
                  global_pool=True,
                  output_stride=None,
                  spatial_squeeze=True,
                  reuse=None,
                  scope='resnet_v2_101'):
  """ResNet-101 model of [1]. See resnet_v2() for arg and return description."""
  blocks = [
      resnet_v2_block('block1', base_depth=64, num_units=3, stride=2),
      resnet_v2_block('block2', base_depth=128, num_units=4, stride=2),
      resnet_v2_block('block3', base_depth=256, num_units=23, stride=2),
      resnet_v2_block('block4', base_depth=512, num_units=3, stride=1),
  ]
  return resnet_v2(inputs, blocks, num_classes, is_training=is_training,
                   global_pool=global_pool, output_stride=output_stride,
                   include_root_block=True, spatial_squeeze=spatial_squeeze,
                   reuse=reuse, scope=scope) 
开发者ID:ringringyi,项目名称:DOTA_models,代码行数:21,代码来源:resnet_v2.py

示例2: resnet_v2_101

# 需要导入模块: from tensorflow.contrib.slim.nets import resnet_v2 [as 别名]
# 或者: from tensorflow.contrib.slim.nets.resnet_v2 import resnet_v2_101 [as 别名]
def resnet_v2_101(inputs,
                  num_classes=None,
                  is_training=True,
                  global_pool=True,
                  output_stride=None,
                  spatial_squeeze=False,
                  reuse=None,
                  scope='resnet_v2_101'):
  """ResNet-101 model of [1]. See resnet_v2() for arg and return description."""
  blocks = [
      resnet_v2_block('block1', base_depth=64, num_units=3, stride=2),
      resnet_v2_block('block2', base_depth=128, num_units=4, stride=2),
      resnet_v2_block('block3', base_depth=256, num_units=23, stride=2),
      resnet_v2_block('block4', base_depth=512, num_units=3, stride=1),
  ]
  return resnet_v2(inputs, blocks, num_classes, is_training=is_training,
                   global_pool=global_pool, output_stride=output_stride,
                   include_root_block=True, spatial_squeeze=spatial_squeeze,
                   reuse=reuse, scope=scope) 
开发者ID:ih-lab,项目名称:STORK,代码行数:21,代码来源:resnet_v2.py

示例3: resnet_v2_101

# 需要导入模块: from tensorflow.contrib.slim.nets import resnet_v2 [as 别名]
# 或者: from tensorflow.contrib.slim.nets.resnet_v2 import resnet_v2_101 [as 别名]
def resnet_v2_101(inputs,
                  num_classes=None,
                  is_training=True,
                  global_pool=True,
                  output_stride=None,
                  spatial_squeeze=True,
                  reuse=tf.AUTO_REUSE,
                  scope='resnet_v2_101'):
  """ResNet-101 model of [1]. See resnet_v2() for arg and return description."""
  blocks = [
      resnet_v2_block('block1', base_depth=64, num_units=3, stride=2),
      resnet_v2_block('block2', base_depth=128, num_units=4, stride=2),
      resnet_v2_block('block3', base_depth=256, num_units=23, stride=2),
      resnet_v2_block('block4', base_depth=512, num_units=3, stride=1),
  ]
  return resnet_v2(inputs, blocks, num_classes, is_training=is_training,
                   global_pool=global_pool, output_stride=output_stride,
                   include_root_block=True, spatial_squeeze=spatial_squeeze,
                   reuse=reuse, scope=scope) 
开发者ID:lambdal,项目名称:lambda-deep-learning-demo,代码行数:21,代码来源:resnet_v2.py

示例4: resnet_v2_101

# 需要导入模块: from tensorflow.contrib.slim.nets import resnet_v2 [as 别名]
# 或者: from tensorflow.contrib.slim.nets.resnet_v2 import resnet_v2_101 [as 别名]
def resnet_v2_101(inputs,
                  num_classes=None,
                  is_training=True,
                  multi_grid=[1, 2, 4],
                  global_pool=True,
                  output_stride=None,
                  spatial_squeeze=True,
                  reuse=None,
                  scope='resnet_v2_101'):
    """ResNet-101 model of [1]. See resnet_v2() for arg and return description."""
    blocks = [
        resnet_v2_block('block1', base_depth=64, num_units=3, stride=2),
        resnet_v2_block('block2', base_depth=128, num_units=4, stride=2),
        resnet_v2_block('block3', base_depth=256, num_units=23, stride=2),
        resnet_v2_block('block4', base_depth=512, num_units=3, stride=1),
    ]
    return resnet_v2(inputs, blocks, num_classes, is_training=is_training,
                     global_pool=global_pool, output_stride=output_stride, multi_grid=multi_grid,
                     include_root_block=True, spatial_squeeze=spatial_squeeze,
                     reuse=reuse, scope=scope) 
开发者ID:autoai-org,项目名称:CVTron,代码行数:22,代码来源:resnet_v2.py

示例5: resnet_v2_101

# 需要导入模块: from tensorflow.contrib.slim.nets import resnet_v2 [as 别名]
# 或者: from tensorflow.contrib.slim.nets.resnet_v2 import resnet_v2_101 [as 别名]
def resnet_v2_101(inputs,
                  num_classes=None,
                  is_training=True,
                  global_pool=True,
                  output_stride=None,
                  spatial_squeeze=True,
                  reuse=False,
                  scope='resnet_v2_101'):
  """ResNet-101 model of [1]. See resnet_v2() for arg and return description."""
  blocks = [
      resnet_v2_block('block1', base_depth=64, num_units=3, stride=2),
      resnet_v2_block('block2', base_depth=128, num_units=4, stride=2),
      resnet_v2_block('block3', base_depth=256, num_units=23, stride=2),
      resnet_v2_block('block4', base_depth=512, num_units=3, stride=1),
  ]
  return resnet_v2(inputs, blocks, num_classes, is_training=is_training,
                   global_pool=global_pool, output_stride=output_stride,
                   include_root_block=True, spatial_squeeze=spatial_squeeze,
                   reuse=reuse, scope=scope) 
开发者ID:alibaba,项目名称:FastNN,代码行数:21,代码来源:resnet_v2.py

示例6: resnet_v2_101

# 需要导入模块: from tensorflow.contrib.slim.nets import resnet_v2 [as 别名]
# 或者: from tensorflow.contrib.slim.nets.resnet_v2 import resnet_v2_101 [as 别名]
def resnet_v2_101(inputs,
                  num_classes=None,
                  is_training=True,
                  global_pool=True,
                  output_stride=None,
                  reuse=None,
                  scope='resnet_v2_101'):
  """ResNet-101 model of [1]. See resnet_v2() for arg and return description."""
  blocks = [
      resnet_utils.Block(
          'block1', bottleneck, [(256, 64, 1)] * 2 + [(256, 64, 2)]),
      resnet_utils.Block(
          'block2', bottleneck, [(512, 128, 1)] * 3 + [(512, 128, 2)]),
      resnet_utils.Block(
          'block3', bottleneck, [(1024, 256, 1)] * 22 + [(1024, 256, 2)]),
      resnet_utils.Block(
          'block4', bottleneck, [(2048, 512, 1)] * 3)]
  return resnet_v2(inputs, blocks, num_classes, is_training=is_training,
                   global_pool=global_pool, output_stride=output_stride,
                   include_root_block=True, reuse=reuse, scope=scope) 
开发者ID:rwightman,项目名称:tensorflow-litterbox,代码行数:22,代码来源:resnet_v2.py

示例7: resnet_v2_101

# 需要导入模块: from tensorflow.contrib.slim.nets import resnet_v2 [as 别名]
# 或者: from tensorflow.contrib.slim.nets.resnet_v2 import resnet_v2_101 [as 别名]
def resnet_v2_101(inputs,
                  num_classes=None,
                  is_training=True,
                  global_pool=True,
                  output_stride=None,
                  spatial_squeeze=True,
                  reuse=None,
                  scope='resnet_v2_101',
                  attention_module=None):
  """ResNet-101 model of [1]. See resnet_v2() for arg and return description."""
  blocks = [
      resnet_v2_block('block1', base_depth=64, num_units=3, stride=2, attention_module=attention_module),
      resnet_v2_block('block2', base_depth=128, num_units=4, stride=2, attention_module=attention_module),
      resnet_v2_block('block3', base_depth=256, num_units=23, stride=2, attention_module=attention_module),
      resnet_v2_block('block4', base_depth=512, num_units=3, stride=1, attention_module=attention_module),
  ]
  return resnet_v2(inputs, blocks, num_classes, is_training=is_training,
                   global_pool=global_pool, output_stride=output_stride,
                   include_root_block=True, spatial_squeeze=spatial_squeeze,
                   reuse=reuse, scope=scope) 
开发者ID:kobiso,项目名称:CBAM-tensorflow-slim,代码行数:22,代码来源:resnet_v2.py

示例8: resnet_v2_101

# 需要导入模块: from tensorflow.contrib.slim.nets import resnet_v2 [as 别名]
# 或者: from tensorflow.contrib.slim.nets.resnet_v2 import resnet_v2_101 [as 别名]
def resnet_v2_101(inputs,
                  num_classes=None,
                  global_pool=True,
                  output_stride=None,
                  reuse=None,
                  scope='resnet_v2_101'):
  """ResNet-101 model of [1]. See resnet_v2() for arg and return description."""
  blocks = [
      resnet_utils.Block(
          'block1', bottleneck, [(256, 64, 1)] * 2 + [(256, 64, 2)]),
      resnet_utils.Block(
          'block2', bottleneck, [(512, 128, 1)] * 3 + [(512, 128, 2)]),
      resnet_utils.Block(
          'block3', bottleneck, [(1024, 256, 1)] * 22 + [(1024, 256, 2)]),
      resnet_utils.Block(
          'block4', bottleneck, [(2048, 512, 1)] * 3)]
  return resnet_v2(inputs, blocks, num_classes, global_pool, output_stride,
                   include_root_block=True, reuse=reuse, scope=scope) 
开发者ID:tobegit3hub,项目名称:deep_image_model,代码行数:20,代码来源:resnet_v2.py

示例9: resnet_v2_101

# 需要导入模块: from tensorflow.contrib.slim.nets import resnet_v2 [as 别名]
# 或者: from tensorflow.contrib.slim.nets.resnet_v2 import resnet_v2_101 [as 别名]
def resnet_v2_101(inputs,
                  num_classes=None,
                  is_training=True,
                  global_pool=True,
                  output_stride=None,
                  spatial_squeeze=True,
                  reuse=None,
                  scope='resnet_v2_101'):
  """ResNet-101 model of [1]. See resnet_v2() for arg and return description."""
  blocks = [
      resnet_utils.Block(
          'block1', bottleneck, [(256, 64, 1)] * 2 + [(256, 64, 2)]),
      resnet_utils.Block(
          'block2', bottleneck, [(512, 128, 1)] * 3 + [(512, 128, 2)]),
      resnet_utils.Block(
          'block3', bottleneck, [(1024, 256, 1)] * 22 + [(1024, 256, 2)]),
      resnet_utils.Block(
          'block4', bottleneck, [(2048, 512, 1)] * 3)]
  return resnet_v2(inputs, blocks, num_classes, is_training=is_training,
                   global_pool=global_pool, output_stride=output_stride,
                   include_root_block=True, spatial_squeeze=spatial_squeeze,
                   reuse=reuse, scope=scope) 
开发者ID:nicklhy,项目名称:DLInfBench,代码行数:24,代码来源:resnet_v2.py

示例10: forward

# 需要导入模块: from tensorflow.contrib.slim.nets import resnet_v2 [as 别名]
# 或者: from tensorflow.contrib.slim.nets.resnet_v2 import resnet_v2_101 [as 别名]
def forward(self, inputs, num_classes, data_format, is_training):
        sc = resnet_arg_scope(
            weight_decay=0.0001,
            data_format=data_format,
            batch_norm_decay=0.997,
            batch_norm_epsilon=1e-5,
            batch_norm_scale=True,
            activation_fn=tf.nn.relu,
            use_batch_norm=True,
            is_training=is_training)
        with slim.arg_scope(sc):
            logits, end_points = resnet_v2_101(
                inputs,
                num_classes=num_classes,
                is_training=is_training,
                global_pool=True,
                output_stride=None,
                reuse=None,
                scope=self.scope)
            return logits, end_points 
开发者ID:balancap,项目名称:tf-imagenet,代码行数:22,代码来源:resnet_v2.py

示例11: resnet_v2_101

# 需要导入模块: from tensorflow.contrib.slim.nets import resnet_v2 [as 别名]
# 或者: from tensorflow.contrib.slim.nets.resnet_v2 import resnet_v2_101 [as 别名]
def resnet_v2_101(inputs,
                  num_classes=None,
                  is_training=True,
                  global_pool=True,
                  output_stride=None,
                  spatial_squeeze=True,
                  reuse=None,
                  scope='resnet_v2_101'):
    """ResNet-101 model of [1]. See resnet_v2() for arg and return description."""
    blocks = [
        resnet_v2_block('block1', base_depth=64, num_units=3, stride=2),
        resnet_v2_block('block2', base_depth=128, num_units=4, stride=2),
        resnet_v2_block('block3', base_depth=256, num_units=23, stride=2),
        resnet_v2_block('block4', base_depth=512, num_units=3, stride=1),
    ]
    return resnet_v2(inputs, blocks, num_classes, is_training=is_training,
                     global_pool=global_pool, output_stride=output_stride,
                     include_root_block=True, spatial_squeeze=spatial_squeeze,
                     reuse=reuse, scope=scope) 
开发者ID:balancap,项目名称:tf-imagenet,代码行数:21,代码来源:resnet_v2.py


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