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

Training on age & custom factor - generated model dimension issue #19

Closed
taewookim opened this issue Oct 25, 2017 · 5 comments
Closed

Comments

@taewookim
Copy link

taewookim commented Oct 25, 2017

Hey Yusuke

This is a continuation from issue 17.

After i ran train.py, I generated checkpoints, along with these files:

In you predict.ipynb, I changed the

model.load_weights(os.path.join("pretrained_models", "weights.18-4.06.hdf5"))

to

model.load_weights("WRN_16_8.h5")

And I'm getting this odd error:

ValueError: Dimension 0 in both shapes must be equal, but are 131072 and 32768 for 'Assign_137' (op: 'Assign') with input shapes: [131072,2], [32768,2].

Any ideas where I might've gone wrong? I made sure I am using same widenet_res.py in both training and in prediction

BTW, I changed the nb_epoch from 30 to 100 during training but i doubt this is the cause...?

@yu4u
Copy link
Owner

yu4u commented Oct 26, 2017

Hi, you seem to have trained the network using images with 32x32 size.
Therefore, img_size = 32 will fix the issue.

@taewookim
Copy link
Author

Oh wow. Once again, thank you SO much for your help. That worked!

Out of curiosity.. how were u able to figure that out w/o looking at my code?

@bsonnenschein
Copy link

It is evident because 131072/32768 = 4 just as 64x64/(32x32) = 4.

@taewookim
Copy link
Author

taewookim commented Oct 26, 2017

wow.. you are sharp indeed. never even occurred to me to calculate that.
once again, thank you @bsonnenschein and @yu4u

@yu4u
Copy link
Owner

yu4u commented Oct 26, 2017

@bsonnenschein is right. And I saw "batch_input_shape": [null, 32, 32, 3] in WRN_16_8.json =D

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

3 participants