How can I use importKerasNetwork function to Import a pretrained VGGFace Keras network and weights?

조회 수: 4 (최근 30일)
How can I use importKerasNetwork function to Import a pretrained VGGFace Keras network and weights and use it for transfer learning?

채택된 답변

Maria Duarte Rosa
Maria Duarte Rosa 2019년 7월 5일
Hi Ibrahim,
layers = importKerasLayers(modelfile) imports the architecture and weights of Keras models saved as .h5 files. These files have to be generated from Keras.
After importing the layers, these can be modified for transfer learning as described here:
I hope this helps,
Maria
  댓글 수: 2
Ibrahim Mohammed
Ibrahim Mohammed 2019년 7월 6일
Thanks Maria for the quick response,
I couldn't find the keras version of VGGFace in the official keras library, but I found one on github at this link: https://github.com/rcmalli/keras-vggface. Is there any way to access this model using importKerasLayers function so that I can use it for transfer learning?
Thanks.
Runnan Cao
Runnan Cao 2020년 1월 10일
Hi lbrahim,
Is there any chance that you could share the vgg-face.h5 files with me?
Many thanks!!!
Runnan

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Maria Duarte Rosa
Maria Duarte Rosa 2019년 7월 9일
Hi Ibrahim, you first need to install and run the python package as described in the GitHub page to obtain the model (including weights), then save this model as .h5 file. Once you have the model saved in .h5 you can use importKerasLayers to load the model into MATLAB.
  댓글 수: 4
Alex Zai
Alex Zai 2020년 12월 2일
Hello dears,
i have a few question. I want to use pretrained facenet model in guthub site, in the following link: https://github.com/nyoki-mtl/keras-facenet.
In this link already had trained model (facenet.h5) file. How can i import to Matlab it, please?
I tried to used any suggestion like that : importKerasNetwork, importKerasLayers and downloaded and saved in matlab location, then tried read (h5info). But i can't imported which i wanted that (facenet_keras.h5) to Matlab.
If any suggestion or someone can help me, please...
Thank you very much.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by