Skip to content
Advertisement

While predicting on trained model I’ve getting an Image shape error

I use the deeptrack library (that also uses tensorflow) to train a model dealing with cell counting using UNet.

This is the code defines the UNet model using deeptrack (dt) library:

JavaScript

And this is the summary of the model I trained:

JavaScript

And when I try to make a prediction with the model I trained, with a 256X256 image (both color and grayscale) – I encounter the following error:

JavaScript

I couldn’t understand why the error message shows image dimensions of 32X256 when in practice it is 256X256?

How can I overcome the above problem?

Advertisement

Answer

You need to add a batch dimension to your image, try:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement