Replies: 1 comment
-
If the only reported input is |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have created a lstm network in Matlab and converted it to onnx using matlabs exportONNXNetwork.
My network is a SeriesNetwork with
Layers: [5x1 nnet.cnn.layer.Layer]
layers =
Sequence Input Sequence input with 6 dimensions (numberOfFeatures)
LSTM LSTM with 50 hidden units
Fully connected 2 fully connected layers
Softmax softmax
Clasification Output crossentropyex
Sequence length is 24.
Creating Ortsession from this model:
{sequenceinput=NodeInfo(name=sequenceinput,info=TensorInfo(javaType=FLOAT,onnxType=ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT,shape=[-1, -1, 6]))}
The OnnxTensor is created from float[nOfSequences][sequenceLength][sequenceInput=6 dim] :
var testData = new float[nOfSequences][sequenceLength][nOfFeatures];
OrtEnvironment env = OrtEnvironment.getEnvironment();
OnnxTensor onnxTensor = OnnxTensor.createTensor(env, testData);
Map<String, OnnxTensor> container = new HashMap<>();
SessionOptions options = new SessionOptions();
OrtSession session = env.createSession("lstm.onnx", options);
Map<String, NodeInfo> inMeta = session.getInputInfo();
String inputName = session.getInputNames().iterator().next();
container.put(inputName, onnxTensor);
try (Result result = session.run(container)) {}
This returns an onnxruntimeerror:
Non-zero status code returned while running LSTM node. Name:'lstm' Status Message: Input initial_h must have shape {1,24,50}. Actual:{1,1,50}
Where can I change the shape of initial_h?
Beta Was this translation helpful? Give feedback.
All reactions