def _block_stem_res(net, endpoints, scope='Stem'):
# Simpler _stem for inception-resnet-v1 network
# NOTE observe endpoints of first 3 layers
# default padding = VALID
# default stride = 1
with arg_scope([layers.conv2d, layers.max_pool2d, layers.avg_pool2d], padding='VALID'):
with tf.variable_scope(scope):
# 299 x 299 x 3
net = layers.conv2d(net, 32, [3, 3], stride=2, scope='Conv1_3x3/2')
endpoints[scope + '/Conv1'] = net
# 149 x 149 x 32
net = layers.conv2d(net, 32, [3, 3], scope='Conv2_3x3')
endpoints[scope + '/Conv2'] = net
# 147 x 147 x 32
net = layers.conv2d(net, 64, [3, 3], padding='SAME', scope='Conv3_3x3')
endpoints[scope + '/Conv3'] = net
# 147 x 147 x 64
net = layers.max_pool2d(net, [3, 3], stride=2, scope='Pool1_3x3/2')
# 73 x 73 x 64
net = layers.conv2d(net, 80, [1, 1], padding='SAME', scope='Conv4_1x1')
# 73 x 73 x 80
net = layers.conv2d(net, 192, [3, 3], scope='Conv5_3x3')
# 71 x 71 x 192
net = layers.conv2d(net, 256, [3, 3], stride=2, scope='Conv6_3x3/2')
# 35 x 35 x 256
endpoints[scope] = net
print('%s output shape: %s' % (scope, net.get_shape()))
return net
build_inception_v4.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录