tensorflow: Atrous convolution does not preserve tensor shape

For an input with an undefined batch size, atrous_conv2d emits tensors where all except the final dimension are undefined:

input = tf.placeholder(tf.float32, (None, 256, 256, 3))

conv = tf.nn.conv2d(input, tf.zeros((3, 3, 3, 16)), strides=[1, 1, 1, 1], padding='SAME')
print(conv.get_shape()) # Correctly displays (?, 256, 256, 16)

dilated = tf.nn.atrous_conv2d(input, tf.zeros((3, 3, 3, 16)), rate=2, padding='SAME')
print(dilated.get_shape()) # Displays (?, ?, ?, 16)

(For concrete batch sizes, everything works as expected.)

Tested on 0.10.0rc0

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 24 (15 by maintainers)

Most upvoted comments

Indeed I have reproduced the problem. I believe @gpapan implemented atrous_conv2d, and might have thoughts on how easy this would be to fix.