Transfer Learning with ONNX

The notebooks retrieve the already converted onnx model for SqueezeNet and uses it in a pipeline created with scikit-learn.

Retrieve the ONNX model

An image

ImageNet classes

Next cell is only about the list of class names associated to the ImageNet competition. Better to jump to the next part.

Preprocessing, zooming, predicting

Transfer Learning

The class OnnxTransformer wraps a runtime into a class which follows scikit-learn API.

Let's normalize the probabilities within a pipeline.

Merge ONNX graphs in a pipeline

The output probabilities are now normalized. What if we want to merge the ONNX got from the model zoo and the added normalizer...

The previous error is due to the fact the downloaded ONNX file was saved in a different opset. We need to reuse this one for the conversion of the whole pipeline.

We convert again.