How do I generate code that uses a TensorFlow model without using the TensorFlow library?

I have an existing TensorFlow deep learning network. I would like to use it in code generated from MATLAB, but I do not want the generated code to depend on the TensorFlow library. Do I have any options to achieve this?

 採用された回答

MathWorks Support Team
MathWorks Support Team 2024 年 6 月 25 日

0 投票

While you cannot use the TensorFlow model directly in the generated code without introducing a dependency on the TensorFlow library, you can convert your existing network to MATLAB's "dlnetwork" format, and use that in anything you would like to generate code from. The function to convert your network is called "importNetworkFromTensorFlow", and it is documented here:
Note that you will need to install the Deep Learning Toolbox™ Converter for TensorFlow Models Support Package to use this function.
For information and guides on how to generate code from your new "dlnetwork", please see the Deep Learning Code Generation category in our documentation:

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by