Deploy in JS

How can i deploy/inference the model trained in MXNet with JS?
On MXNet website, there is no API for JS
I only found github link for JS
So, is there any stable release for MXNetJS?

Hi @dcshendu, there isn’t a stable release, but you might be able to get something working with mxnet.js. I don’t see any active development on this project, and this issue has been submitted. But the amalgamation that it relies on should be in a working state.

1 Like

@thomelane, Thank you, I will take a look at them.

The option my group is using is to export to Onnx and then use Onnxjs.

There are some limitations of course:

  1. If you’re using Gluon, you must have a hybrid block so you can turn it into a symbol that can be converted to Onnx.
  2. Mxnet cannot currently export all operators to onnx, but most are there.
  3. OnnxJS does not support all operators defined by Onnx, but most are there.

If it’s a fairly straightforward network, you’ll probably be fine. If The MXNet exporter is missing exports for operators you need, it’s not too hard to extend it to add support, but it may take you some work to understand how that works since it’s not especially well documented yet. But I have done it.

I haven’t tried extending OnnxJS if it’s missing something. That seems a little trickier since it’s a runtime.

2 Likes