When I set --res_n 50, the code will report a error.
def resblock(x_init, channels, is_training=True, use_bias=True, downsample=False, scope='resblock') :
with tf.variable_scope(scope) :
x = batch_norm(x_init, is_training, scope='batch_norm_0')
x = relu(x)
if downsample :
x = conv(x, channels, kernel=3, stride=2, use_bias=use_bias, scope='conv_0')
x_init = conv(x_init, channels, kernel=1, stride=2, use_bias=use_bias, scope='conv_init')
else :
x = conv(x, channels, kernel=3, stride=1, use_bias=use_bias, scope='conv_0')
x = batch_norm(x, is_training, scope='batch_norm_1')
x = relu(x)
x = conv(x, channels, kernel=3, stride=1, use_bias=use_bias, scope='conv_1')
return x + x_init
Dimensions of x and x_init are not equal.