You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not all models are available in Hugging Face. You may use AxonONNX or ORTEX to run ONNX models models.
1. From PyTorch to Axon
This video is interesting because it explains how to use a model that is not necessarily directly usable into Bumblebee (eg models from Hugging Face).
It takes a PyTorch based pre-trained model (meaning the architecture of layers and operations with their parameters) and serialises into the ONNX format. This model is then imported into the Elixir world with axon_onnx.
Note that you need to know what the model expects.
They used Kino.Input in the Livebook to read and get an Nx.tensor from an image, but you would use StbImage or, for more advanced features, Vix or Image.
2. Livebook from Axon docs
This livebook uses only Axon and StbImage to load an ONNX model and run predictions.
You may skip the steps above.
The blog post below explains that you can use the ONNX runtime bindings to load and run directly an ONNX model and get an Nx.tensor.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Misc readings.
Not all models are available in Hugging Face. You may use
AxonONNX
orORTEX
to run ONNX models models.1. From PyTorch to Axon
This video is interesting because it explains how to use a model that is not necessarily directly usable into
Bumblebee
(eg models from Hugging Face).It takes a
PyTorch
based pre-trained model (meaning the architecture of layers and operations with their parameters) and serialises into theONNX
format. This model is then imported into the Elixir world withaxon_onnx
.They used
Kino.Input
in the Livebook to read and get anNx.tensor
from an image, but you would use StbImage or, for more advanced features, Vix or Image.2. Livebook from Axon docs
This livebook uses only
Axon
andStbImage
to load an ONNX model and run predictions.3. Blog on Ortex
You may skip the steps above.
The blog post below explains that you can use the ONNX runtime bindings to load and run directly an ONNX model and get an
Nx.tensor
.Beta Was this translation helpful? Give feedback.
All reactions