def Bottleneck(x, is_training,block_name, outplanes, stride=1, downsample=None):
residual = x
with tf.variable_scope(block_name + '11_1'):
name = block_name + 'conv1'
out = conv(x, 1, outplanes, name=name, stride=stride)
out = batch_norm(out,is_training)
out = tf.nn.relu(out)
with tf.variable_scope(block_name + '33_2'):
name = block_name + 'conv2'
out = conv(x, 3, outplanes, name=name, stride=stride)
out = batch_norm(out,is_training)
out = tf.nn.relu(out)
with tf.variable_scope(block_name + '11_3'):
name = block_name + 'conv3'
out = conv(out, 1, outplanes * 4, name=name, stride=stride)
out = batch_norm(out,is_training)
if downsample is not None:
with tf.variable_scope(block_name + 'downsample'):
residual = downsample(x,1,outplanes * 4, 'stage_dawnSample',stride = stride)
residual = batch_norm(residual, is_training)
out = out + residual
out = tf.nn.relu(out)
return out
def Bottleneck(x, is_training,block_name, outplanes, stride=1, downsample=None): residual = x with tf.variable_scope(block_name + '11_1'): name = block_name + 'conv1' out = conv(x, 1, outplanes, name=name, stride=stride) out = batch_norm(out,is_training) out = tf.nn.relu(out)
请问,bottleneck模块中,33卷积的输入为什么是x?我按照原理来理解这里的输入应该是上一个11卷积的输出,这么设置是有什么原因么?谢谢~