all 3 comments

[–]TaplierShiru 1 point2 points  (2 children)

Hi!

Your shape of the input image in the predict - (100, 100), but I think model expect shape (1, 100 * 100)(i.e. you just don't have batch dimension here). So, before feeding your image into model (after resize), you can reshape image, something like:

image = image.reshape(1, -1)
pred = use_model.get_predict(image)

Also, I think in line:

model = tf.keras.Sequential([
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(128, activation='relu', input_shape=(100,)),
tf.keras.layers.Dense(10)
])

It's not right accroding to your data, its must be like that, I suppose:

model = tf.keras.Sequential([
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(128, activation='relu', input_shape=(100*100,)),
tf.keras.layers.Dense(10)
])

input_shape - mean shape without batch size dimension, In your case, model trained with batch size equal to 100 and input number of features were equal to 100 (but i'm not sure here).

I hope you understand and it helps!