HSE_FaceRec_tf
HSE_FaceRec_tf copied to clipboard
How do I train vggface2 and get my own model?
How do I train vggface2 and get my own pre model?
Sorry for delay in answer. My notifications were not enebaled for this repository. I added an old code facerec_keras_train.py to train the baseline model on VGGFace2 dataset. This procedure is straightforward, that's why it was not presented in this repository initially.
Hello Can you please specify the procedure for tuning age_gender model?
Script age_gender_identity/age_gender_train.py is used to tune the age-gender model. I am not sure that it will work right now with the recent version of Keras. Nevertheless, it is necessary to prepare two folders (age and gender), each of them should contain train and val parts (see code). I simply used concatenation of IMDB-Wiki and Adience datasets. The former has some mistakes for small ages, so that I corrected them manually. The latter contains the age ranges only, so that I used the middle of this range as a ground truth label. Please see details in the paper
Script age_gender_identity/age_gender_train.py is used to tune the age-gender model. I am not sure that it will work right now with the recent version of Keras. Nevertheless, it is necessary to prepare two folders (age and gender), each of them should contain train and val parts (see code). I simply used concatenation of IMDB-Wiki and Adience datasets. The former has some mistakes for small ages, so that I corrected them manually. The latter contains the age ranges only, so that I used the middle of this range as a ground truth label. Please see details in the paper
I am trying to do the same but it is showing errors with paths also the 2 folders you are talking about, age and gender must have images in them?
Yes, sure, they should contain images, as they are passed to flow_from_directory() method. The errors maybe caused by some incompatibility with versions of Keras, etc. Unfortunately, I do not have enough time now to make this code fully compatible with recent Tensorflow, but I believe you could do it by yourself. It is maybe better if you could share the errors you got
6 окт. 2021 г., в 18:02, maria-zafar @.***> написал(а):
Script age_gender_identity/age_gender_train.py is used to tune the age-gender model. I am not sure that it will work right now with the recent version of Keras. Nevertheless, it is necessary to prepare two folders (age and gender), each of them should contain train and val parts (see code https://github.com/HSE-asavchenko/HSE_FaceRec_tf/blob/master/age_gender_identity/age_gender_train.py#L139). I simply used concatenation of IMDB-Wiki and Adience datasets. The former has some mistakes for small ages, so that I corrected them manually. The latter contains the age ranges only, so that I used the middle of this range as a ground truth label. Please see details in the paper https://peerj.com/articles/cs-197/ I am trying to do the same but it is showing errors with paths also the 2 folders you are talking about, age and gender must have images in them?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HSE-asavchenko/HSE_FaceRec_tf/issues/2#issuecomment-936451789, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFZQMVGKYJXD7YPRS4FXUZTUFRQIJANCNFSM4HRTWV7Q. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Can you share your email where I can share the screenshots of error?
It will be better if you could copy your screenshots directly here so that other users can take a look at this issues. It is possible to simply drag-n-drop any image into github tracker
okay so this is what I am getting
It simply means that there is no such folder. Check it by running something like !ls content/drive/MyDrive ... If you use Colab, I believe you need to run from google.colab import drive drive.mount('/content/gdrive/')
and then use absolute path /content/gdrive/My Drive/
It simply means that there is no such folder. Check it by running something like !ls content/drive/MyDrive ... If you use Colab, I believe you need to run from google.colab import drive drive.mount('/content/gdrive/')
and then use absolute path /content/gdrive/My Drive/
the folder is already there if you notice the command right above %run you'll see I have given the path already
Any suggestions about how to fix this?
This is exactly the compatibility issue. Try to change num_class to num_classes at lines 161 and 165.
Yes this is working!
Okay I have trained the model using age_gender_train.py and it saves models in the model folder in hdf5 extension however, for inference I have to use facial_analysis.py and in that it uses .pb so how do I create that?
Just run the same age gender train with arguments --modelpath and path to your hdf5 file. It is still possible that there are some issues with compatibility because Tensorflow 2.x hides many pb-related methods. The same is true for facial_analysis. For example, tf.gfile.GFile should be renamed to tf.io.gfile.GFile
yes it is constantly giving error on this. Any suggestions how to fix this tried changing versions, did with tfand keras oalone but it is not getting fixed
Input class is located in tensorflow.keras ( https://www.tensorflow.org/api_docs/python/tf/keras/Input). However, this is a general part of the code. I wonder why you did not see the same error while training the model.
пт, 8 окт. 2021 г. в 07:12, maria-zafar @.***>:
yes it is constantly giving error on this. Any suggestions how to fix this tried changing versions, did with tfand keras oalone but it is not getting fixed
[image: image] https://user-images.githubusercontent.com/69984290/136497101-e03aadd0-f671-4d2c-b94f-7aed8d861e7c.png
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HSE-asavchenko/HSE_FaceRec_tf/issues/2#issuecomment-938328127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFZQMVHVDIQMND7SP4A25JDUFZVRNANCNFSM4HRTWV7Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
-- С уважением, А.В. Савченко
Input class is located in tensorflow.keras ( https://www.tensorflow.org/api_docs/python/tf/keras/Input). However, this is a general part of the code. I wonder why you did not see the same error while training the model. пт, 8 окт. 2021 г. в 07:12, maria-zafar @.***>: … yes it is constantly giving error on this. Any suggestions how to fix this tried changing versions, did with tfand keras oalone but it is not getting fixed [image: image] https://user-images.githubusercontent.com/69984290/136497101-e03aadd0-f671-4d2c-b94f-7aed8d861e7c.png — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFZQMVHVDIQMND7SP4A25JDUFZVRNANCNFSM4HRTWV7Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. -- С уважением, А.В. Савченко
Basically it gives an error when the function convert_to_tf() is called in age-gender-train.py. So at first I was training without giving modelpath and it saved the models in .hdf5 only but with path I guess it shall save the model in .pb.