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: Cannot assign to variable conv3_block1_0_conv/kernel:0 due to variable shape (1, 1, 256, 512) and value shape (512, 128, 1, 1) are incompatible,with h5py==2.10.0 #7

Open
liumgg opened this issue Mar 10, 2021 · 9 comments

Comments

@liumgg
Copy link

liumgg commented Mar 10, 2021

after load the trained weights 'bmi_model_weights.h5', it return ValueError: Cannot assign to variable conv3_block1_0_conv/kernel:0 due to variable shape (1, 1, 256, 512) and value shape (512, 128, 1, 1) are incompatible, i tried to change the data_fromat but it did not use

@liumgg liumgg closed this as completed Mar 10, 2021
@liumgg
Copy link
Author

liumgg commented Mar 10, 2021

after load the trained weights 'bmi_model_weights.h5', it return ValueError: Cannot assign to variable conv3_block1_0_conv/kernel:0 due to variable shape (1, 1, 256, 512) and value shape (512, 128, 1, 1) are incompatible, i tried to change the data_fromat but it did not use

@liumgg liumgg reopened this Mar 10, 2021
@liumgg liumgg changed the title ValueError: Cannot assign to variable conv3_block1_0_conv/kernel:0 due to variable shape (1, 1, 256, 512) and value shape (512, 128, 1, 1) are incompatible ValueError: Cannot assign to variable conv3_block1_0_conv/kernel:0 due to variable shape (1, 1, 256, 512) and value shape (512, 128, 1, 1) are incompatible,with h5py==2.10.0 Mar 10, 2021
@gadididi
Copy link

gadididi commented Apr 4, 2021

after load the trained weights 'bmi_model_weights.h5', it return ValueError: Cannot assign to variable conv3_block1_0_conv/kernel:0 due to variable shape (1, 1, 256, 512) and value shape (512, 128, 1, 1) are incompatible, i tried to change the data_fromat but it did not use

I have the same issue..
do you have any solution for this?

@luantunez
Copy link

Same, please help :)

@codexsys-7
Copy link

help please!!!

@trifle
Copy link

trifle commented Jul 16, 2022

Since there's quite a couple of people having this issue:

model.load_weights(weight_file,by_name=True)

This allows loading the model. Found in yu4u/age-gender-estimation#140

@noovil
Copy link

noovil commented Sep 28, 2022

Since there's quite a couple of people having this issue:

model.load_weights(weight_file,by_name=True)

This allows loading the model. Found in yu4u/age-gender-estimation#140

I tried this solution and it runs, but the predicted BMI is single digit or even negative sometimes.

@Learneruestc
Copy link

model.load_weights(weight_file,by_name=True)
it works for me.

@neharai070
Copy link

Since there's quite a couple of people having this issue:
model.load_weights(weight_file,by_name=True)
This allows loading the model. Found in yu4u/age-gender-estimation#140

I tried this solution and it runs, but the predicted BMI is single digit or even negative sometimes.

I

@neharai070
Copy link

neharai070 commented Dec 20, 2023

I am also getting negative bmi , how to resolve this please help @Learneruestc @noovil

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

8 participants