GithubHelp home page GithubHelp logo

jaoh / mcnpytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from albanie/mcnpytorch

0.0 1.0 0.0 623 KB

Model converter (PyTorch -> MatConvNet)

License: MIT License

Python 81.72% MATLAB 12.90% Shell 5.38%

mcnpytorch's Introduction

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:

  • Python3
  • PyTorch
  • standard numerical Python modules (which should be easy to install with conda)
  • The Cadene repo of pre-trained pytorch models (adds support for additional networks which are not included in the main torchvision module)

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

  • The normalisation used by the pretrained PyTorch models differs significantly from the typical matconvnet approach (see here for an example).
  • The weights in the converted model are modified slightly from the originals to compensate for differences in certain computational blocks. For instance, PyTorch adds an espilon term to batch norm denominator during both training and inference.

mcnpytorch's People

Contributors

albanie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.