title: Keras CONV1D: Error when checking target: expected decoded output to have shape (50, 50) but got array with shape (50, 1)
body: <p>I have this trouble: Error when checking target: expected decoded_output to have shape (50, 50) but got array with shape (50, 1) With this code, an autoencoder with CONV1D and two output, but the trouble is the reconstruction output (decode_output):</p>
  
  <pre><code>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)
  
  TAM_VECTOR = X_train.shape[1]
  
  input_tweet = Input(shape=(TAM_VECTOR,X_train.shape[2]))
  
  encoded = Conv1D(64, kernel_size=1, activation='relu')(input_tweet)
  encoded = Conv1D(32, kernel_size=1, activation='relu')(encoded)
  
  decoded = Conv1D(32, kernel_size=1, activation='relu')(encoded)
  decoded = Conv1D(64, kernel_size=1, activation='relu')(decoded)
  decoded = Conv1D(TAM_VECTOR, kernel_size=1, activation='relu', name='decode_output')(decoded)
  
  encoded = Flatten()(encoded)
  second_output = Dense(1, activation='linear', name='second_output')(encoded)
  
  autoencoder = Model(inputs=input_tweet, outputs=[decoded, second_output])
  
  autoencoder.compile(optimizer="adam",
                      loss={'decode_output': 'mse', 'second_output': 'mse'},
                      loss_weights={'decode_output': 0.001, 'second_output': 0.999},
                      metrics=["mae"])
  
  autoencoder.fit([X_train], [X_train, y_train], epochs=10, batch_size=32)
  </code></pre>
  
  <p>The input (X) has shape (50000,50) but since Conv1D recives a 3D input I reshape to:</p>
  
  <pre><code>X = np.reshape(X, (X.shape[0], X.shape[1], -1))
  </code></pre>
  
  <p>(50000,50,1)</p>
  
  <p>And y (the second output) is</p>
  
  <pre><code>y.shape
  </code></pre>
  
  <p>(50000,1)</p>
  
  <p>And here the model summary</p>
  
  <pre><code>Layer (type)                    Output Shape         Param #     Connected to                     
  ==================================================================================================
  input_43 (InputLayer)           (None, 50, 1)        0                                            
  __________________________________________________________________________________________________
  conv1d_169 (Conv1D)             (None, 50, 64)       128         input_43[0][0]                   
  __________________________________________________________________________________________________
  conv1d_170 (Conv1D)             (None, 50, 32)       2080        conv1d_169[0][0]                 
  __________________________________________________________________________________________________
  conv1d_171 (Conv1D)             (None, 50, 32)       1056        conv1d_170[0][0]                 
  __________________________________________________________________________________________________
  conv1d_172 (Conv1D)             (None, 50, 64)       2112        conv1d_171[0][0]                 
  __________________________________________________________________________________________________
  flatten_62 (Flatten)            (None, 1600)         0           conv1d_170[0][0]                 
  __________________________________________________________________________________________________
  decode_output (Conv1D)          (None, 50, 50)       3250        conv1d_172[0][0]                 
  __________________________________________________________________________________________________
  pib_output (Dense)              (None, 1)            1601        flatten_62[0][0]                 
  ==================================================================================================
  Total params: 10,227
  Trainable params: 10,227
  Non-trainable params: 0
  </code></pre>