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

2 visualizzazioni (ultimi 30 giorni)
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 Commento
Balrog
Balrog il 26 Lug 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"

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Image Data Workflows in Help Center e File Exchange

Tag

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by