How can I make a file containing only weights when using codegen

조회 수: 1 (최근 30일)
Kyung Woon So
Kyung Woon So 2023년 12월 2일
편집: Sayan Saha 2023년 12월 3일
I did code generation using following command
" codegen -config cfg my_predict -args {inputData} -report "
In the codegen files, there are weights for deeplearning network as shown in below picture.
However, I do not want the weights to be in ".c" file.
I want to make an external file that contains only weights.
Is there a way I can do?
I will be waiting for your reply.
Thank you.

답변 (1개)

Sayan Saha
Sayan Saha 2023년 12월 3일
편집: Sayan Saha 2023년 12월 3일
Hello,
Looking at the generated code I assume you are generating code for the deep learning network with "TargetLibrary = none" set in the coder configuration object. Currently, it is not possible to generate the weights in a separate file with "TargetLibrary = none" setting. In the upcoming release, we are going to provide an option that will generate the weights in a separate binary file. For now, if you want to generate the weights separately, you'll have to use a "TargetLibrary" other than "none", for example, "mkldnn/arm-compute" for CPU targets or "cudnn/tensorrt" for GPU targets. For these target libraries, the weights are always generated in a separate binary file. Here's the documentation page for how to generate code for "mkldnn" https://www.mathworks.com/help/coder/ug/code-generation-for-deep-learning-networks-with-mkl-dnn.html. Note that the entire process of generating code remains the same, except for setting the "DeepLearningConfig" on the coder configuration object.
Hope this helps,
Sayan

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by