필터 지우기
필터 지우기

Error using importKerasLayers() for Squeezenet using ".json" file.

조회 수: 3 (최근 30일)
BHUSHAN MUTHIYAN
BHUSHAN MUTHIYAN 2017년 10월 26일
댓글: Marco Francini 2017년 11월 30일
Hello,
I am trying to use the new Neural Network Toolbox function named "importKerasLayers" to import Squeezenet model. But it gives me below error:
*Error using importKerasLayers
Invalid layer name 'fire2/squeeze1x1'. Layer names must not contain the character '/'.*
Please, let me know about it.
I have also tried importing ".h5" file for Squeezenet. But it gives me below error:
*Error using importKerasLayers
Unable to import layers from file 'squeezenet_weights.h5' because it contains no 'model_config' attribute.*
Can you provide a ".json" or ".h5" file for Squeezenet which supports MATLAB.
Looking forward to solve this problem as soon as possible.
Thank you.

채택된 답변

Mickaël Tits
Mickaël Tits 2017년 11월 14일
Hi,
I had the same problem, so I modified a python script to change layer names (tu use "_" instead of "/"). You can find the corrected model here : https://github.com/titsitits/Squeezenet-Matlab-Keras You can use this line of code to import it :
squeezenet = importKerasNetwork('squeezenet.json','WeightFile','squeezenet.h5','OutputLayerType','classification');
Best regards, Mickaël Tits
  댓글 수: 3
Mickaël Tits
Mickaël Tits 2017년 11월 19일
Hello,
It is actually the version v1.1, which apparently has similar results than v1.0, with much less computations: https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1
I don't have the v1.0 version unfortunately. If you really need the version 1.0, you can try to modify the python script and use the weights of the v1.0.
Regards, Mickaël Tits
Marco Francini
Marco Francini 2017년 11월 30일
Hello, it is working also for me.
Now that I uploaded the Squeezenet to Matlab I used it with transfer learning techninque so it can handle just 3 classes. It is working fine.
Now that I have my network trained, how can I export it to .h5 and .json file? I see that an "exportKerasNetwork" function does not exists...

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by