3

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.

1 Answers1

0

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

faxu
  • 1
  • 2
    You can convert models from tensorflow to js using the official tensorflowjs_convertor. So it would be ONNX -> Tensorflow (using tensorflow-onnx) -> tensorflow.js (using tensorflowjs_convertor). – Stanley Aug 04 '21 at 00:05