本文整理汇总了Python中nets.nasnet.pnasnet.large_imagenet_config方法的典型用法代码示例。如果您正苦于以下问题:Python pnasnet.large_imagenet_config方法的具体用法?Python pnasnet.large_imagenet_config怎么用?Python pnasnet.large_imagenet_config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nets.nasnet.pnasnet
的用法示例。
在下文中一共展示了pnasnet.large_imagenet_config方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testNoAuxHeadLargeModel
# 需要导入模块: from nets.nasnet import pnasnet [as 别名]
# 或者: from nets.nasnet.pnasnet import large_imagenet_config [as 别名]
def testNoAuxHeadLargeModel(self):
batch_size = 5
height, width = 331, 331
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.large_imagenet_config()
config.set_hparam('use_aux_head', int(use_aux_head))
with slim.arg_scope(pnasnet.pnasnet_large_arg_scope()):
_, end_points = pnasnet.build_pnasnet_large(inputs, num_classes,
config=config)
self.assertEqual('AuxLogits' in end_points, use_aux_head)
示例2: testOverrideHParamsLargeModel
# 需要导入模块: from nets.nasnet import pnasnet [as 别名]
# 或者: from nets.nasnet.pnasnet import large_imagenet_config [as 别名]
def testOverrideHParamsLargeModel(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()
config = pnasnet.large_imagenet_config()
config.set_hparam('data_format', 'NCHW')
with slim.arg_scope(pnasnet.pnasnet_large_arg_scope()):
_, end_points = pnasnet.build_pnasnet_large(
inputs, num_classes, config=config)
self.assertListEqual(
end_points['Stem'].shape.as_list(), [batch_size, 540, 42, 42])
示例3: testNoAuxHeadLargeModel
# 需要导入模块: from nets.nasnet import pnasnet [as 别名]
# 或者: from nets.nasnet.pnasnet import large_imagenet_config [as 别名]
def testNoAuxHeadLargeModel(self):
batch_size = 5
height, width = 331, 331
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.large_imagenet_config()
config.set_hparam('use_aux_head', int(use_aux_head))
with slim.arg_scope(pnasnet.pnasnet_large_arg_scope()):
_, end_points = pnasnet.build_pnasnet_large(inputs, num_classes,
config=config)
self.assertEqual('AuxLogits' in end_points, use_aux_head)
示例4: testOverrideHParamsLargeModel
# 需要导入模块: from nets.nasnet import pnasnet [as 别名]
# 或者: from nets.nasnet.pnasnet import large_imagenet_config [as 别名]
def testOverrideHParamsLargeModel(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()
config = pnasnet.large_imagenet_config()
config.set_hparam('data_format', 'NCHW')
with slim.arg_scope(pnasnet.pnasnet_large_arg_scope()):
_, end_points = pnasnet.build_pnasnet_large(
inputs, num_classes, config=config)
self.assertListEqual(
end_points['Stem'].shape.as_list(), [batch_size, 540, 42, 42])