zsrkmyn / pytorch_loadcaffe

An unofficial library for PyTorch to load caffe model.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyTorch loadcaffe

An unofficial library for PyTorch to load caffe model.

NOTE: The project is currently work-in-process, so there may be many bugs. Use it at your own risk. Issues and Pull Requests are welcomed.

Requirements

  • PyTorch
  • python-protobuf

Build Requirements

  • protobuf

Installation

git clone https://github.com/zsrkmyn/pytorch_loadcaffe
cd pytorch_loadcaffe
sudo python setup.py install

Usage

>>> import loadcaffe
>>> net = loadcaffe.load('some.caffemodel')

Troubleshooting

The load process is too slow

A potential reason is that your python-protobuf isn't built with --cpp_implementation options, which may use pure python code to parse protobuf and cause really bad performance. See here for more information.

NotImplementedError occurs

The project currently supports the following caffe layers:

  • Convolution (2D only)
  • Pooling (2D only)
  • ReLU
  • Sigmoid
  • Tanh
  • InnerProduct
  • Dropout
  • SoftmaxWithLoss
  • Softmax

Pull requests are welcomed :-)

About

An unofficial library for PyTorch to load caffe model.

License:MIT License


Languages

Language:Protocol Buffer 86.6%Language:Python 13.4%