using .json pretraind model in matlab

and now i have two files: 1)model.json 2)group1-shard1of1.bin
how can i use this pretrined model in matlab
or convert this pretrained model to .h5 model

답변 (1개)

Shreeya
Shreeya 2023년 9월 5일

0 개 추천

Hi Amir
You can import a pretrained JSON/h5 model in matlab as a neural network using the "importKerasNetwork".The argument passed to the function is the file name of the model you wish to import. It returns a pretrained keras neural network which can be used for further prediction tasks.
Hope this helps.

댓글 수: 3

thanks.but not work.... download model from : https://tfhub.dev/mediapipe/tfjs-model/handskeleton/1/default/1
Shreeya
Shreeya 2023년 9월 6일
Try passing in the .bin file as the 'WeightFile' argument.
modelfile = 'model.json';
weights = 'group1-shard1of2.bin';
net = importKerasNetwork(modelfile,'WeightFile',weights, ...
'OutputLayerType','classification')
Error using nnet.internal.cnn.keras.importKerasNetwork
Error reading Keras model_config from file 'model.json'. The error message
was: 'Unrecognized field name "keras_version".''

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

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

질문:

2023년 9월 4일

댓글:

2023년 9월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by