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

error when checking target #140

Closed
shardul2903 opened this issue Aug 12, 2019 · 4 comments
Closed

error when checking target #140

shardul2903 opened this issue Aug 12, 2019 · 4 comments

Comments

@shardul2903
Copy link

i) in your model.py
input_size (256,256,1) => (256,256,3)
ii) trainGenerator function in your data.py
image_color_mode ="grayscale"=>"rgb"
iii) testGenerator function in your data.py
comment out "img = np.reshape(img,img.shape+(1,)) if (not flag_multi_class) else img"

Originally posted by @teamo429 in #59 (comment)

I followed the above steps but I get the following error:
ValueError: Error when checking target: expected conv2d_24 to have shape (256, 256, 1) but got array with shape (256, 256, 3)

@reachsak
Copy link

have you resolve this problem , I'm having the exact same problems , hope your solution help

@sudhasubramaniam
Copy link

In data.py we have in testGenerator
img = np.reshape(img,img.shape+(1,)) if (not flag_multi_class) else img
you have change it to
img = np.reshape(img,img.shape+(3,)) if (not flag_multi_class) else img
This will solve the issue

@shardul2903
Copy link
Author

@sudhasubramaniam thanks

@manvirvirk
Copy link

i have made above changes as images but i git following error:
ValueError: Error when checking target: expected conv2d_11 to have shape (16, 16, 1) but got array with shape (256, 256, 1)
Can you please solve it. Thanks @shardul2903 @sudhasubramaniam

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

4 participants