yu4u / age-gender-estimation

Keras implementation of a CNN network for age and gender estimation
MIT License
1.47k stars 503 forks source link

about use trained model to evaluate the parameter by python evaluate_appa_real.py #62

Open boyang24 opened 6 years ago

boyang24 commented 6 years ago

hi thanks for your project,and i have a question,when i use python evaluate_appa_real.py to test my model,it throwed one question like this: ValueError: You are trying to load a weight file containing 1 layers into a model with 31 layers. so how to solve this? thanks

yu4u commented 6 years ago

What is your model? It seems to be containing 1 layers; something may be wrong with the model.

boyang24 commented 6 years ago

What is your model? It seems to be containing 1 layers; something may be wrong with the model.

when i use the demo.py to run,it will download the weights.28-3.73.hdf5 file automatic,and i train the model,the train.py code i never change,every parameter is default,then i got: image because i want to test the image one by one,not video,so i changed the code ,and tested under weights.28-3.73.hdf5,and it is ok ,except the accuarcy no problem. i use the trained parameter to test demo.py it is like :+1: image except this no change,under this,it throw like: image i checked this problem,some one said it is because the version is too new,need to change to 2.1.*,i tried,but same problem,so please help me to solve this problem,thanks again

yu4u commented 6 years ago

Did you mean this issue?

https://github.com/keras-team/keras/issues/10417

need to change to 2.1.*,i tried,but same problem

Did you try from training the model or simply downgrade to Keras 2.1. and do load_weights that were trained on Keras 2.2.?

boyang24 commented 6 years ago

Did you mean this issue?

keras-team/keras#10417

need to change to 2.1.*,i tried,but same problem

Did you try from training the model or simply downgrade to Keras 2.1. and do load_weights that were trained on Keras 2.2.? right i train the model under keras 2.2.2,and i founded the error above,then i changed the version of keras to 2.1.*,but i still use the 2.2.2 trained parameter to test demo.py,is this problem?i try it now

yu4u commented 6 years ago

I guess training on Keras 2.1.* solves the problem.

boyang24 commented 6 years ago

I guess training on Keras 2.1.* solves the problem.

problem already solved thanks

boyang24 commented 6 years ago

after the training,epochs with parameter --aug,the result is : image and test the last few by APPA-REAL dataset,the best result is : image i test it by the single image,it is not that good,so if i want a better result,what should i do ? another problem is i change the code for mutil gpu training under keras 2.1.4 right now,if i add "model=multi_gpu_model(model, gpus=2)",it will be an error,but this did not happen under keras 2.2.2,so how to solve this problem?thanks,

yu4u commented 6 years ago

Please follow this discussion https://github.com/yu4u/age-gender-estimation/issues/48 for improving accuracy

I have not tried multi-gpu training thus I have no ideas.