title: how to reshape input image array from 1d to 3d
body: <p>I have built the image classifier as bellow:</p>
  
  <pre><code>import tensorflow as tf
  from tensorflow.keras.applications.mobilenet import preprocess_input
  
  image_width, image_height = 224, 224
  input_shape = (image_width, image_height, 3)
  self.model = tf.keras.Sequential()
          pretrained_layer = tf.keras.applications.mobilenet.MobileNet(
              weights="imagenet", include_top=False, input_shape=self.input_shape
          )
  self.model.add(pretrained_layer)
  self.model.add(tf.keras.layers.GlobalAveragePooling2D())
  self.model.add(tf.keras.layers.Dense(256, activation="relu"))
  self.model.add(tf.keras.layers.Dropout(0.5))
  self.model.add(tf.keras.layers.Dense(128, activation="relu"))
  self.model.add(tf.keras.layers.Dropout(0.2))
  self.model.add(tf.keras.layers.Dense(len(DATA_LABELS), activation="sigmoid"))
  
  self.model.compile(
              optimizer=tf.keras.optimizers.Adam(0.0005),
              loss="binary_crossentropy",
              metrics=["accuracy"],
          )
  </code></pre>
  
  <p>I also had a predict function that expect input as numpy array</p>
  
  <pre><code>def predict(self, image):
      """Predict the labels for a single screenshot
         image -- The numpy array of the image to classify
      """
      img = np.expand_dims(image, axis=0)
      img = preprocess_input(img)
  
      prediction = self.model.predict(img, batch_size=1)
  </code></pre>
  
  <p>Now I get an image which is 1d numpy array (23280,), when I feed this to the prediction model I get error as below:</p>
  
  <pre><code>prediction = model.predict(np.asarray(bytearray(ss_read)))  # np.asarray(bytearray(ss_read)) is 1d numpy array (23280,)
  </code></pre>
  
  <pre><code>ValueError: Error when checking input: expected mobilenet_1.00_224_input to have 4 dimensions, but got array with shape (1, 23280)
  </code></pre>
  
  <p>so, how can I reshape this numpy array and make it ready for the predictor? I think I can do something like <code>np.reshape(np.asarray(bytearray(ss_read)), (image_width, image_height, 3))</code>, but the total amount of data is not exactly the same after reshape in this case (224 * 224 * 3 = 150528 > 23280). should I do something like this instead <code>np.reshape(np.asarray(bytearray(ss_read)), (image_width, -1, 3))</code>?</p>