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.
- PyTorch
- python-protobuf
- protobuf
git clone https://github.com/zsrkmyn/pytorch_loadcaffe
cd pytorch_loadcaffe
sudo python setup.py install
>>> import loadcaffe >>> net = loadcaffe.load('some.caffemodel')
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.
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 :-)