Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load a onnx model on tensorflow.js?

I'm creating a program using Tensorflow.js. It should receive an onnx file and be able to load it with tf, being able to make inferences.

My problem is how to convert it from onnx to tfjs?

I would rather solve it using just js. (so i can't use https://github.com/onnx/onnx-tensorflow cause python)

If it helps the file contains an image classfication cnn, being either resNet18, resnet34 or mobilenet.

like image 801
Matheus Campos Avatar asked Oct 29 '25 10:10

Matheus Campos


1 Answers

An alternative solution may be to use ONNX Runtime Web's Javascript API - https://github.com/microsoft/onnxruntime/blob/master/js/web

ORT Web takes ONNX models directly.

Side note - tfjs models conversion via the Tensorflow-ONNX converter (https://github.com/onnx/tensorflow-onnx) is also in the works and will be released soon

like image 76
faxu Avatar answered Nov 01 '25 13:11

faxu