title: Keras TimeDistributed Conv1D Error
body: <p>This is my code:</p>
  
  <pre><code>cnn_input = Input(shape=(cnn_max_length,)) 
  emb_output = Embedding(num_chars + 1, output_dim=32, input_length=cnn_max_length, trainable=True)(cnn_input)
  output = TimeDistributed(Convolution1D(filters=128, kernel_size=4, activation='relu'))(emb_output)
  </code></pre>
  
  <p>I want to train a character-level CNN sequence labeler and I keep receiving this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "word_lstm_char_cnn.py", line 24, in &lt;module&gt;
      output = kl.TimeDistributed(kl.Convolution1D(filters=128, kernel_size=4, activation='relu'))(emb_output)
    File "/home/user/anaconda3/envs/thesisenv/lib/python3.6/site-packages/keras/engine/base_layer.py", line 457, in __call__
      output = self.call(inputs, **kwargs)
  es/keras/layers/wrappers.py", line 248, in call
      y = self.layer.call(inputs, **kwargs)
    File "/home/user/anaconda3/envs/thesisenv/lib/python3.6/site-packages/keras/layers/convolutional.py", line 160, in call
      dilation_rate=self.dilation_rate[0])
    File "/home/user/anaconda3/envs/thesisenv/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 3526, in conv1d
      data_format=tf_data_format)
    File "/home/user/anaconda3/envs/thesisenv/lib/python3.6/site-packages/tensorflow/python/ops/nn_ops.py", line 779, in convolution
      data_format=data_format)
    File "/home/user/anaconda3/envs/thesisenv/lib/python3.6/site-packages/tensorflow/python/ops/nn_ops.py", line 828, in __init__
      input_channels_dim = input_shape[num_spatial_dims + 1]
    File "/home/user/anaconda3/envs/thesisenv/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py", line 615, in __getitem__
      return self._dims[key]
  IndexError: list index out of range
  </code></pre>
  
  <p>The input is 3D, as it should be. If I change the input shape I receive this error:</p>
  
  <pre><code>ValueError: Input 0 is incompatible with layer time_distributed_1: expected ndim=3, found ndim=4
  </code></pre>