Metadata-Version: 2.0
Name: pytorch2caffe
Version: 0.1.0
Summary: A package to convert pytorch model to caffe model
Home-page: https://github.com/woodsgao/pytorch2caffe
Author: woodsgao
Author-email: woodsgao@outlook.com
License: MIT
Platform: UNKNOWN
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.5.2
Description-Content-Type: text/markdown
Requires-Dist: numpy (>=1.11)
Requires-Dist: torch (>=1.0)


# pytorch2caffe

A package to convert pytorch model to caffe model. 

## Installation

`pip3 install pytorch2caffe`

or

    git clone https://github.com/woodsgao/pytorch2caffe
    cd pytorch2caffe
    python3 setup.py install

## Tutorials

Note: import torch first then import pytorch2caffe

    import torch
    from torchvision.models import resnet
    from pytorch2caffe import pytorch2caffe

    name='resnet18'
    resnet18=resnet.resnet18()
    resnet18.eval()
    dummy_input=torch.ones([1,3,224,224])
    pytorch2caffe.trans_net(resnet18, dummy_input, name)
    pytorch2caffe.save_prototxt('{}.prototxt'.format(name))
    pytorch2caffe.save_caffemodel('{}.caffemodel'.format(name))


