Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Input 0 is incompatible with layer model: expected shape=(None, 224, 224, 3), found shape=(None, 240, 320, 3) #150

Open
JosephMartinelli opened this issue Jun 26, 2021 · 1 comment

Comments

@JosephMartinelli
Copy link

JosephMartinelli commented Jun 26, 2021

Hello!
I'm having this error while executing train.py. Although the target shape is correct i can't wrap my head around the expected shape.

I'll leave the stack trace:
traceback.txt

@JosephMartinelli
Copy link
Author

Maybe I've found a solution but i really don't know if it's the optimal way to do it since I've hard coded it in extractor.py but there is it:

In extractor.py there is a function called:
   def extract(self, image_path):
        img = image.load_img(image_path)
        return self.extract_image(img)

I have modified it in this way:

   def extract(self, image_path):
        img = image.load_img(image_path,target_size=(224,224,3))
        return self.extract_image(img)

So I have forced the reshaping of the image loaded. The train.py seems running fine. I'll share any issues I'll find along the training

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant