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

1 次查看(过去 30 天)
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 个评论
Balrog
Balrog 2020-7-26
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"

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by