title: Tensorflow Lite - Input shape must be 5 dimensional error
body: <p>I am trying to port a tensorflow model to tensorflow lite to use it in an android application. The conversion is successful and everything runs except for <code>Internal error: Failed to run on the given Interpreter: input must be 5-dimensional</code>. The input in the original model was <code>input_shape=(20, 320, 240, 1)</code>, which is 20 320 x 240 grayscale images (therefore ...,1). Here is the important code:</p>
  
  <pre><code>List&lt;Mat&gt; preprocessedFrames = preprocFrames(buf);
  //has length of 20 -&gt; no problem there (shouldn't affect dimensionality either...)
  
          int[] output = new int[2];
          float[][][] inputMatrices = new float[preprocessedFrames.toArray().length][320][240];
  
          for(int i = 0; i &lt; preprocessedFrames.toArray().length; i++) {
              Mat inpRaw = preprocessedFrames.get(i);
  
              Bitmap data = Bitmap.createBitmap(inpRaw.cols(), inpRaw.rows(), Bitmap.Config.ARGB_8888);
              Utils.matToBitmap(inpRaw, data);
  
              int[][] pixels = pixelsFromBitmap(data);
              float[][] inputMatrix = inputMatrixFromIntPixels(pixels);
              // returns float[][] with floats from 0 to 1
  
              inputMatrices[i] = inputMatrix;
          }
  
          try{
  
              detector.run(inputMatrices, output);
              Debug("results: " + output.toString());
          }
  </code></pre>
  
  <p>The model gives me an output of 2 neurons translating into 2 labels.
  The model code is the following:</p>
  
  <pre><code>model = tf.keras.Sequential(name='detector')
      model.add(tf.keras.layers.Conv3D(filters=(56), input_shape=(20, 320, 240, 1), strides=(2,2,2), kernel_size=(3,11,11), padding='same', activation="relu"))
      model.add(tf.keras.layers.AveragePooling3D(pool_size=(1,4,4)))
      model.add(tf.keras.layers.Conv3D(filters=(72), kernel_size=(4,7,7), strides=(1,2,2), padding='same'))
      model.add(tf.keras.layers.Conv3D(filters=(81), kernel_size=(2,4,4), strides=(2,2,2), padding='same'))
      model.add(tf.keras.layers.Conv3D(filters=(100), kernel_size=(1,2,2), strides=(3,2,2), padding='same'))
      model.add(tf.keras.layers.Conv3D(filters=(128), kernel_size=(1,2,2), padding='same'))
      model.add(tf.keras.layers.Flatten())
      model.add(tf.keras.layers.Dense(768, activation='tanh', kernel_regularizer=tf.keras.regularizers.l2(0.011)))
      model.add(tf.keras.layers.Dropout(rate=0.1))
      model.add(tf.keras.layers.Dense(256, activation='sigmoid', kernel_regularizer=tf.keras.regularizers.l2(0.012)))
      model.add(tf.keras.layers.Dense(2, activation='softmax'))
  
      model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=0.00001), loss=tf.keras.losses.CategoricalCrossentropy(),
          metrics=['accuracy'])
  </code></pre>
  
  <p>EDIT: I printed out the first input tensor as follows: </p>
  
  <pre><code>int[] shape = detector.getInputTensor(0).shape();
              for(int r = 0; r &lt; shape.length; r++){
                  Log.d("********" + r, "*******: " + r + " : " + shape[r]);
              }
  </code></pre>
  
  <p>With that I  first get the output [1,20,320,240,1]and after that I only get [20,320,240]. I am really quite desperate now...</p>