Export Model from Matlab To ONNX

16 views (last 30 days)
Abolfazl Nejatian
Abolfazl Nejatian on 30 Jul 2023
Commented: Jiangyin on 24 Apr 2024 at 20:01
I am currently working on a multi-label image classification project in MATLAB and python.
I have developed a custom binary cross entropy loss layer. To extend the functionality of my model i use Python and try to export model with the ONNX framework.
However, I have encountered a notable discrepancy between the results obtained from MATLAB and ONNX. Despite my efforts to ensure proper conversion and preservation of model integrity, the outputs obtained through ONNX differ from the ones achieved within MATLAB.
the below example is what exactly i try to export.
a multi-label image classification using deep learning tutorial found at the following link: https://www.mathworks.com/help/deeplearning/ug/multilabel-image-classification-using-deep-learning.html
i think the diffrences between Matlab and ONNX rised from the CustomBinaryCrossEntropyLossLayer.
Thank you in advance for any guidance to solve this problem.
  1 Comment
Jiangyin
Jiangyin on 24 Apr 2024 at 20:01
Hi Abolfazl,
Sorry that I'm a bit confused over what's your workflow.
Did you create a CustomBinaryCrossEntropyLossLayer in Python, export it to ONNX file, and import in MATLAB.
or
create a CustomBinaryCrossEntropyLossLayer in MATLAB, export the model to ONNX file, and import in Python?
For either workflow, is there any warning or error message thrown from MATLAB side?
Best,
Jiangyin

Sign in to comment.

Answers (0)

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!