Skip to content

Latest commit

 

History

History
 
 

PyTorch Model Inference using ONNX and Caffe2

This repository contains the code for PyTorch Model Inference using ONNX and Caffe2 blog post.

download

We show how to do inference with a PyTorch model using ONNX and Caffe2.

Dependencies

torch
torchvision
onnx

Create conda environment

conda env create -f environment.yml

Download models

The required models can be downloaded from the following links: Animals Caltech

Activate conda environment

conda activate pytorch_inference

Outline

The enclosed notebook lets you

  1. Export the PyTorch .pt model to ONNX model
  2. Use the ONNX model for inference in Caffe2

More details can be found in the blog

AI Courses by OpenCV

Want to become an expert in AI? AI Courses by OpenCV is a great place to start.