Skip to content

Files

Latest commit

author
Tim M
Jan 18, 2023
57b5cef · Jan 18, 2023

History

History

PyTorch-to-CoreML-model-conversion

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

PyTorch to CoreML model conversion

This repository contains the code for PyTorch to CoreML model conversion blog post.

download

Installation

All required libraries collected in the requirements.txt file. To create a new virtual environment and install the requirements, you can use these commands:

$ virtualenv -p python3.7 venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Run the script

To convert any model from torchvision.models you can try our script by using this command:

$ python3 torch_to_coreml.py --model_name resnet18 --simplify

The --model_name argument should contain the name of any model from torchvision.models

AI Courses by OpenCV

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