ONNX file exported from MATLAB doesn't work with other frameworks

2 Ansichten (letzte 30 Tage)
Balrog
Balrog am 26 Jul. 2020
Bearbeitet: Balrog am 26 Jul. 2020
I have a simple LSTM net exported as ONNX and I tried to use it with X-Cube-AI in ST and when it flagged an error with no apparent explanation, I moved to convert the ONNX to keras
import onnx2keras
from onnx2keras import onnx_to_keras
import keras
import onnx
onnx_model = onnx.load('adamLSTM_50.onnx')
k_model = onnx_to_keras(onnx_model, ['sequenceinput'])
Errors
(DEBUG:onnx2keras:Check if all inputs are available:
DEBUG:onnx2keras:Check input 0 (name sequenceinput).
DEBUG:onnx2keras:The input not found in layers / model inputs.)
It would be great if someone can help with what the problem could be?
  1 Kommentar
Balrog
Balrog am 26 Jul. 2020
I find that the layers(1).Name etc are empty and I filled those. But after that I see after loading the model in python, there are fields that are empty. One of this is related to sequence_lens. I am not sure of what to do?
>>> onnx_model.graph.node
[input: "Input"
input: "BiLSTM_W"
input: "BiLSTM_R"
input: "BiLSTM_B"
input: ""
input: "BiLSTM_initial_h"
input: "BiLSTM_initial_c"
output: ""
output: "BiLSTM"
name: "BiLSTM"

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Image Data Workflows finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by