Borrar filtros
Borrar filtros

onnxExport/onnxImport functions not working correctly

1 visualización (últimos 30 días)
Luke Hubbard
Luke Hubbard el 27 de Mzo. de 2023
Comentada: Sivylla Paraskevopoulou el 4 de Abr. de 2023
I'm having trouble exporting to onnx. As a test case, I tried using https://www.mathworks.com/help/deeplearning/ug/classify-sequence-data-using-lstm-networks.html. I add the following section between the training and testing blocks and got the data format error as shown below.
exportONNXNetwork doesn't raise any issues, but importONNXNetwork does.
If I import with the following option set,
importONNXNetwork('onnxEx1.onnx','OutputsDataFormat','TBC')
it works fine. All is well, right? except that onnxruntime in other environments doesn't work. Trying to load the onnx file with onnxruntime in another environment (python, java) results in a 'ShapeInferenceError' complaining that the tensor must have rank 3.
It must be that exportONNX failing to define something that is required. Are there any workarounds known for this issue? I've tried this locally with R2022b and online which uses R2023a. Both give me the same issue.
  1 comentario
Sivylla Paraskevopoulou
Sivylla Paraskevopoulou el 4 de Abr. de 2023
Does it help to specify the BatchSize name-value argument when you use the exportONNXNetwork function?
Also, if you are planning to use the exported network in TensorFlow, with the exportNetworkToTensorFlow function you can export directly to TensorFlow without first converting to ONNX format.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by