I am working with tensorflow and numpy, and came across an issue where running a probability_model() on a single test example. My array, x_test is a 2d array.
probability_model(x_test[:1])
works properly, however
probability_model(x_test[0])
returns WARNING:tensorflow:Model was constructed with shape Tensor("sequential_input:0", shape=(None, 28, 28), dtype=float32) for input (None, 28, 28), but it was re-called on a Tensor with incompatible shape (28, 28).
I thought that x_test[0] and x_test[:1] would return the same 1D array, however it appears one results in a (None, 28, 28) dimensioned array, and the other results in a (28,28) array. So my question is not about tensorflow (I was just using it to show my error), do these expressions in fact result in different arrays, and if so what is the difference, because when analyzing their outputs they appear the same. Finally, is there an expression I can use to convert x_test[0] to the (None, 28, 28) size I need to call my function?
Thanks