<p dir="auto"><em>Please make sure that this is a bug. As per our <a href="https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md">GitHub Policy</a>, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template</em></p>
<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Custom simple Keras sequential model with Conv1D dilated layers.</li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04</li>
<li>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:</li>
<li>TensorFlow installed from (source or binary): Binary</li>
<li>TensorFlow version (use command below): Works in tf-nightly-gpu-2.0-preview==2.0.0.dev20190410 but fails in tf-nightly-gpu-2.0-preview==2.0.0.dev20190504.</li>
<li>Python version: 3.7</li>
<li>Bazel version (if compiling from source):</li>
<li>GCC/Compiler version (if compiling from source):</li>
<li>CUDA/cuDNN version: 10.0 (installed via conda)</li>
<li>GPU model and memory: Turing (2080 Ti)</li>
</ul>
<p dir="auto"><strong>Describe the current behavior</strong><br>
The output shape is not inferred correctly anymore for a Keras Conv1D with dilation_rate != 1 (it is ok when dilation_rate = 1). Shape inference used to work as expected in tf-nightly-gpu-2.0-preview==2.0.0.dev20190410.</p>
<p dir="auto"><strong>Describe the expected behavior</strong><br>
Please revert to the behaviour available in tf-nightly-gpu-2.0-preview==2.0.0.dev20190410</p>
<p dir="auto"><strong>Code to reproduce the issue</strong><br>
CORRECT behaviour with a dilation_rate=1:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="model = tf.keras.models.Sequential([
    tf.keras.layers.Conv1D(24, kernel_size = 2, dilation_rate = 1, padding='causal',
                           kernel_regularizer=tfk.regularizers.l2(0.01), input_shape=(2560, 8)),
    tf.keras.layers.ReLU(),
    tf.keras.layers.Dense(10),
    tf.keras.layers.Softmax(),
])

model.summary()
Model: &quot;sequential_2&quot;
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
conv1d_26 (Conv1D)           (None, 2560, 24)          408       
_________________________________________________________________
re_lu_23 (ReLU)              (None, 2560, 24)          0         
_________________________________________________________________
dense_3 (Dense)              (None, 2560, 10)          250       
_________________________________________________________________
softmax_2 (Softmax)          (None, 2560, 10)          0         
=================================================================
Total params: 658
Trainable params: 658
Non-trainable params: 0
_________________________________________________________________"><pre class="notranslate"><code class="notranslate">model = tf.keras.models.Sequential([
    tf.keras.layers.Conv1D(24, kernel_size = 2, dilation_rate = 1, padding='causal',
                           kernel_regularizer=tfk.regularizers.l2(0.01), input_shape=(2560, 8)),
    tf.keras.layers.ReLU(),
    tf.keras.layers.Dense(10),
    tf.keras.layers.Softmax(),
])

model.summary()
Model: "sequential_2"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
conv1d_26 (Conv1D)           (None, 2560, 24)          408       
_________________________________________________________________
re_lu_23 (ReLU)              (None, 2560, 24)          0         
_________________________________________________________________
dense_3 (Dense)              (None, 2560, 10)          250       
_________________________________________________________________
softmax_2 (Softmax)          (None, 2560, 10)          0         
=================================================================
Total params: 658
Trainable params: 658
Non-trainable params: 0
_________________________________________________________________
</code></pre></div>
<p dir="auto">Shape inference FAILS with a dilation_rate=2 (or &gt;1): The second dimension of the output shape's is lost,</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="model = tf.keras.models.Sequential([
    tf.keras.layers.Conv1D(24, kernel_size = 2, dilation_rate = 2, padding='causal',
                           kernel_regularizer=tfk.regularizers.l2(0.01), input_shape=(2560, 8)),
    tf.keras.layers.ReLU(),
    tf.keras.layers.Dense(10),
    tf.keras.layers.Softmax(),
])

model.summary()
Model: &quot;sequential_3&quot;
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
conv1d_27 (Conv1D)           (None, None, 24)          408       
_________________________________________________________________
re_lu_24 (ReLU)              (None, None, 24)          0         
_________________________________________________________________
dense_4 (Dense)              (None, None, 10)          250       
_________________________________________________________________
softmax_3 (Softmax)          (None, None, 10)          0         
=================================================================
Total params: 658
Trainable params: 658
Non-trainable params: 0"><pre class="notranslate"><code class="notranslate">model = tf.keras.models.Sequential([
    tf.keras.layers.Conv1D(24, kernel_size = 2, dilation_rate = 2, padding='causal',
                           kernel_regularizer=tfk.regularizers.l2(0.01), input_shape=(2560, 8)),
    tf.keras.layers.ReLU(),
    tf.keras.layers.Dense(10),
    tf.keras.layers.Softmax(),
])

model.summary()
Model: "sequential_3"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
conv1d_27 (Conv1D)           (None, None, 24)          408       
_________________________________________________________________
re_lu_24 (ReLU)              (None, None, 24)          0         
_________________________________________________________________
dense_4 (Dense)              (None, None, 10)          250       
_________________________________________________________________
softmax_3 (Softmax)          (None, None, 10)          0         
=================================================================
Total params: 658
Trainable params: 658
Non-trainable params: 0
</code></pre></div>
<p dir="auto">Please note that the behaviour in 20190410 was correct independently of the dilation_rate.</p>
<p dir="auto"><strong>Other info / logs</strong><br>
This causes more issues downstream as one can't concatenate or sum outputs w.r.t the axis with the unknown shape.</p>
<p dir="auto"><em>Please make sure that this is a bug. As per our <a href="https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md">GitHub Policy</a>, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template</em></p>
<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>Have I written custom code (as opposed to using a stock example script provided in TensorFlow): no</li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): colab</li>
<li>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:</li>
<li>TensorFlow installed from (source or binary): tensorflow-gpu==2.0.0-beta1 colab</li>
<li>TensorFlow version (use command below):tensorflow-gpu==2.0.0-beta1</li>
<li>Python version: pip3</li>
<li>Bazel version (if compiling from source):</li>
<li>GCC/Compiler version (if compiling from source):</li>
<li>CUDA/cuDNN version: colab</li>
<li>GPU model and memory:</li>
</ul>
<p dir="auto"><strong>Describe the current behavior</strong><br>
if tf.keras.layers.Conv2D is used with dilation_rate param &gt; 1 it returns tensors with shape None!</p>