title: problem while giving input to the model and saving the output to a file
body: <p>I have a numpy array having the 512 data points, I want to consider this as the input to my 1d convolutional model.
  After training the model in unsupervised way I want to predict the same input data from the model and want to save to a file</p>
  <p>inp_data can be calculated as</p>
  <pre><code>import numpy as np
  inp_data = np.random.normal(0, .1, 512)
  </code></pre>
  <p>So I did something like</p>
  <pre><code>inp_data = np.expand_dims(inp_data, axis=1) #512,1
  
  
  img_width = inp_data.shape[1]
  img_height = inp_data.shape[0]
  input_img = Input((img_height,img_width))
  
  print(input_img.shape) #(None, 512, 1)
  
  x = Conv1D(256, 16, activation='relu', padding='same', strides=2)(input_img)
  x = Conv1D(128, 16, activation='relu', padding='same',strides=2)(x)
  x = BatchNormalization(name='bn1')(x)
  x = Conv1D(64, 16, activation='relu', padding='same',strides=2 )(x)
  encoded =Conv1D(32, 16, activation='relu', padding='same',strides=2 )(x)
  
  
  
  x = Conv1DTranspose(32, 16,activation='relu', padding='same',strides=2 )(encoded)
  x = Conv1DTranspose(64, 16, activation='relu', padding='same',strides=2 )(x)
  x = BatchNormalization(name='bn3')(x)
  x = Conv1DTranspose(128, 16, activation='relu', padding='same',strides=2)(x)
  x = Conv1DTranspose(256, kernel_size=16, activation='relu', padding='same')(x) 
  
  decoded = Conv1DTranspose(1, 16, activation='sigmoid', padding='same',strides=2)(x)
  
  autoencoder = Model(input_img, decoded)
  sgd = tf.keras.optimizers.Adam(lr=0.001)
  autoencoder.compile(optimizer=sgd, loss='mse')
  
  autoencoder.summary()
  batch = 1
  history = autoencoder.fit(inp_data,inp_data, epochs=50, batch_size=batch, shuffle=True)
  
  
  
  out = autoencoder.predict(inp_data)
  print(out.shape)
  np.savetxt('outfile',out)
  </code></pre>
  <p>However I am getting Errors:</p>
  <pre><code>WARNING:tensorflow:Model was constructed with shape (None, 512, 1) for input KerasTensor(type_spec=TensorSpec(shape=(None, 512, 1), dtype=tf.float32, name='input_1'), name='input_1', description=&quot;created by layer 'input_1'&quot;), but it was called on an input with incompatible shape (32, 1, 1).
  (512, 16, 1)
  </code></pre>
  <p>and while trying to <code>save the predicted output to a file</code> I am getting errors like</p>
  <pre><code>np.savetxt('outfile',out)
    File &quot;&lt;__array_function__ internals&gt;&quot;, line 6, in savetxt
    File &quot;/home/yuanj/SFTR/anaconda3/envs/tfenv/lib/python3.7/site-packages/numpy/lib/npyio.py&quot;, line 1383, in savetxt
      &quot;Expected 1D or 2D array, got %dD array instead&quot; % X.ndim)
  ValueError: Expected 1D or 2D array, got 3D array instead
  </code></pre>
  <p>I hope experts may help me overcoming this problem.Thanks.</p>