microsoft / microsoft/onnxruntime

React Native: Can't load a model: Can't create InferenceSession

Open
#10,302 3 comments 0 reactions 1 assignee View on GitHub

@hanbitmyths is already working on this.

Since Jan 18, 2022.

platform:web
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 8h
Merged PRs (30d)
179

Description

I have converted the Keras model to onnx using onnxmltools on python. the summary of the model is as below:
Model: "sequential"


Layer (type) Output Shape Param #

dense (Dense) (None, 32) 480


dense_1 (Dense) (None, 64) 2112


dense_2 (Dense) (None, 128) 8320


dense_3 (Dense) (None, 64) 8256


dropout (Dropout) (None, 64) 0


dense_4 (Dense) (None, 5) 325

Total params: 19,493
Trainable params: 19,493
Non-trainable params: 0

The converted model is working fine when used on python. In order to use the onnx model in react native, I converted the onnx model to ort format using the script:
python -m onnxruntime.tools.convert_onnx_models_to_ort model.onnx

The converted ORT model works perfectly fine on python but when I use this model in react native it throws exceptions while loading the model
the exceptions is:
[Error: Can't load a model: Can't create InferenceSession]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.