albanie / mcnPyTorch

Model converter (PyTorch -> MatConvNet)
MIT License
62 stars 12 forks source link

PyTorch model converter

NOTICE: This repo is no longer actively maintained.

A tool for converting PyTorch models into MatConvNet.

Imported pretrained models

Some of the useful pretrained models available in the torchvision.models module have been converted into MatConvNet and are available for download at the link below:

Torchvision models

The ResNeXt family of models have also been imported and are available for download:

ResNeXt models

Converting your own models

The conversion script requires Python (with PyTorch installed) and MATLAB. Converting models between frameworks tends to be a non-trivial task, so it is likely that modifications will be needed for unusual models. To get started, see the importer.sh script (this can be modified to import new models).

Installation

The easiest way to use this module is to install it with the vl_contrib package manager. mcnPyTorch can be installed with the following three commands from the root directory of your MatConvNet installation:

vl_contrib('install', 'mcnPyTorch') ;
vl_contrib('setup', 'mcnPyTorch') ;

Dependencies:

To run the imported networks, the following matconvnet modules are also required:

Both of these can be setup directly with vl_contrib (i.e. run vl_contrib install <module-name> then vl_contrib setup <module-name>).

Notes