Issue 1:
Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

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.

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:

TensorFlow installed from (source or binary): Binary

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.

Python version: 3.7

Bazel version (if compiling from source):

GCC/Compiler version (if compiling from source):

CUDA/cuDNN version: 10.0 (installed via conda)

GPU model and memory: Turing (2080 Ti)

Describe the current behavior

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.

Describe the expected behavior

Please revert to the behaviour available in tf-nightly-gpu-2.0-preview==2.0.0.dev20190410

Code to reproduce the issue

CORRECT behaviour with a dilation_rate=1:

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
_________________________________________________________________

Shape inference FAILS with a dilation_rate=2 (or >1): The second dimension of the output shape's is lost,

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

Please note that the behaviour in 20190410 was correct independently of the dilation_rate.

Other info / logs

This causes more issues downstream as one can't concatenate or sum outputs w.r.t the axis with the unknown shape.

Issue 2:
Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): no

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): colab

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:

TensorFlow installed from (source or binary): tensorflow-gpu==2.0.0-beta1 colab

TensorFlow version (use command below):tensorflow-gpu==2.0.0-beta1

Python version: pip3

Bazel version (if compiling from source):

GCC/Compiler version (if compiling from source):

CUDA/cuDNN version: colab

GPU model and memory:

Describe the current behavior

if tf.keras.layers.Conv2D is used with dilation_rate param > 1 it returns tensors with shape None!