RED HAT
DIIDevHeads IoT Integration Server
•Created by Enthernet Code on 8/13/2024 in #code-review
How do I fix a tensor dimension mismatch in TinyML disease detection?
Hello @Enthernet Code The error you’re encountering is due to a mismatch between the
input
image dimensions
expected by your model
and the actual dimensions
of the images being fed into
it. Your model
expects images with a shape of (64, 64, 1)
(grayscale), but the images you’re providing have a shape of (128, 128, 3)
(colored).
To resolve this, you have two options:
1. Preprocess your images to resize them to (64, 64)
and convert them to grayscale before feeding them into the model:
2. If you prefer to use the images in their original size and color, you’ll need to adjust the model’s input shape accordingly:
3 replies