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

Convert source code from channels_first to channels_last #4

Open
daitrandev opened this issue Jan 5, 2018 · 2 comments
Open

Convert source code from channels_first to channels_last #4

daitrandev opened this issue Jan 5, 2018 · 2 comments

Comments

@daitrandev
Copy link

Hi Sasank Chilamkurthy

I have a problem with your source code when trying to convert your model from channels_first to channels_last. I have deleted this line: "K.set_image_data_format('channels_first')" and changed the input_shape from Cov2D() to: input_shape=(IMG_SIZE, IMG_SIZE, 3) instead of input_shape=(3, IMG_SIZE, IMG_SIZE). Then I got an issue: "expected conv2d_1_input to have shape (None, 48, 48, 3) but got array with shape (13320, 3, 48, 48)". How can I fix that? Thanks.

@chsasank
Copy link
Owner

chsasank commented Jan 5, 2018

You also have to move the channel axis in actual inputs. Remove np.rollaxis in preprocess_img

@daitrandev
Copy link
Author

I fixed that. Thanks 👍

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

2 participants