This module let you convert PyTorch models directly to OpenVINO IR without using ONNX
-
Clone repository
git clone --depth 1 https://github.com/openvinotoolkit/openvino_contrib
-
Setup environment
source /opt/intel/openvino_<VERSION>/bin/setupvars.sh export PYTHONPATH=openvino_contrib/modules/mo_pytorch:$PYTHONPATH
-
Convert PyTorch model to OpenVINO IR
import torchvision.models as models # Create model model = models.alexnet(pretrained=True) # Convert to OpenVINO IR import mo_pytorch mo_pytorch.convert(model, input_shape=[1, 3, 227, 227], model_name='alexnet')
torchvision.models.alexnet
torchvision.models.resnet18
torchvision.models.squeezenet1_1
torchvision.models.inception_v3
torchvision.models.segmentation.deeplabv3_resnet50
torchvision.models.detection.mask_rcnn.maskrcnn_resnet50_fpn
Detectron2 RetinaNet
- 3D-ResUNet
- ruGPT3Medium
- USRNet