Onnx: ML per tutti i pc

Volete cominciare a programmare o a curiosare nel mondo AI (intelligenza artificiale) ? partite utilizzando Onnx. Onnx che sta per Open Neural Network Exchange, e` molto supportato in tools, frameworks, applicazioni etcera.
Su ubuntu viene installato semplicemente in questo modo:

git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
git checkout v3.16.0
git submodule update --init --recursive
mkdir build_source && cd build_source
cmake ../cmake -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
make install

Poi con del codice python possiamo convertire ad esempio dei modelli da PyTorch a Caffe2 semplicemente con queste due step:

# Load the ONNX GraphProto object. 
model = onnx.load("super_resolution.onnx")

# prepare the caffe2 backend for converts
prepared_backend = caffe2.python.onnx.backend.prepare(model)

Per altri esempio visitate il link proposti.

Links
https://github.com/onnx/tutorials