3 ms·
Tensorflow (and by extension Keras) offload most of the actual work to C++ or C, so having those compile to WebAssembly would (I imagine) be a herculean effort.
by davidatbu 5y ago
Tensorflow (and by extension Keras) offload most of the actual work to C++ or C, so having those compile to WebAssembly would (I imagine) be a herculean effort.
Instead, The TF team maintains TFJS, which can run on WebAssembly[0].
There are also tractjs[1], and onnyxjs[2], both of which allow you to run (most) ONNX models (which is an open standard for specifying ML models) using WebAssembly and WebGL(only onnyxjs supports WebGL). A bunch of frameworks (caffe, pytorch, TF) support exporting to/importing from ONNX.
[0] https://blog.tensorflow.org/2020/03/introducing-webassembly-backend-for-tensorflow-js.html https://blog.tensorflow.org/2020/03/introducing-webassembly-...
[1] https://github.com/bminixhofer/tractjs https://github.com/bminixhofer/tractjs
[2] https://github.com/microsoft/onnxjs https://github.com/microsoft/onnxjs