• Stars
    star
    494
  • Rank 89,130 (Top 2 %)
  • Language Protocol Buffer
  • License
    BSD 2-Clause "Sim...
  • Created almost 10 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Load Caffe networks in Torch7

loadcaffe

Load Caffe networks in Torch7 http://torch.ch

Install torch first. There is no Caffe dependency, only protobuf has to be installed. In Ubuntu do:

sudo apt-get install libprotobuf-dev protobuf-compiler

In OS X:

brew install protobuf

Then install the package itself:

luarocks install loadcaffe

In Ubuntu 16.04 you need to use gcc-5: CC=gcc-5 CXX=g++-5 luarocks install loadcaffe

Load a network:

require 'loadcaffe'

model = loadcaffe.load('deploy.prototxt', 'bvlc_alexnet.caffemodel', 'ccn2')

Models from Caffe Model Zoo:

Network ccn2 nn cudnn
bvlc_alexnet + - +
bvlc_reference_caffenet + - +
bvlc_reference_rcnn_ilsvrc13 + - +
finetune_flickr_style + - +
VGG_CNN_S + + +
VGG_CNN_M + + +
VGG_CNN_M_2048 + + +
VGG_CNN_M_1024 + + +
VGG_CNN_M_128 + + +
VGG_CNN_F + + +
VGG ILSVRC-2014 16-layer + + +
VGG ILSVRC-2014 19-layer + + +
Network-in-Network Imagenet - + +
Network-in-Network CIFAR-10 - + +
VGG16_SalObjSub + + +
AlexNex_SalObjSub + - +
Binary Hash Codes + - +
Oxford 102 Flowers + - +
Age&Gender + + +
MNIST LeNet - + +

Loading googlenet is supported by https://github.com/soumith/inception.torch For other models with non-sequential structure check https://github.com/nhynes/caffegraph

NN support means both CPU and GPU backends.

You can also use Caffe inside Torch with this: https://github.com/szagoruyko/torch-caffe-binding However you can't use both loadcaffe and caffe in one torch session.

An example of using the package is in examples/mnist_lenet.lua. After running script to train lenet model in Caffe you can easily load and test it in Torch7 on CPU and GPU (with 'cuda' as a first arguments)

Some of ImageNet networks are validated to give reported accuracy in torch in https://github.com/szagoruyko/imagenet-validation.torch

Rights to caffe.proto belong to the University of California.

More Repositories

1

pytorchviz

A small package to create visualizations of PyTorch execution graphs
Jupyter Notebook
3,180
star
2

attention-transfer

Improving Convolutional Networks via Attention Transfer (ICLR 2017)
Jupyter Notebook
1,439
star
3

wide-residual-networks

3.8% and 18.3% on CIFAR-10 and CIFAR-100
Lua
1,297
star
4

diracnets

Training Very Deep Neural Networks Without Skip-Connections
Jupyter Notebook
586
star
5

functional-zoo

PyTorch and Tensorflow functional model definitions
Jupyter Notebook
586
star
6

cvpr15deepcompare

Code and models for "Learning to Compare Image Patches via Convolutional Neural Networks"
C++
467
star
7

pyinn

CuPy fused PyTorch neural networks ops
Python
274
star
8

cifar.torch

92.45% on CIFAR-10 in Torch
Lua
174
star
9

torch-opencv-demos

Torch7+OpenCV+ConvNets
Lua
167
star
10

binary-wide-resnet

PyTorch implementation of Wide Residual Networks with 1-bit weights by McDonnell (ICLR 2018)
Python
124
star
11

imagine-nn

IMAGINE torch neural network routines
Lua
109
star
12

torch-caffe-binding

Use Caffe in Torch7
C++
64
star
13

imagenet-validation.torch

Fast and easy testing of imagenet models
Lua
49
star
14

neural-style-autograd

autograd version of https://github.com/jcjohnson/neural-style
Lua
44
star
15

cunnproduction

easy embeddable Torch7 networks
C++
35
star
16

nnpack.torch

Torch FFI-bindings for NNPACK
Lua
30
star
17

iterm.torch

Display images directly in iTerm2
Lua
28
star
18

openai-gemm.pytorch

PyTorch bindings for openai-gemm
Python
20
star
19

fastrcnn-models.torch

Fast-RCNN models in Torch-7 format
18
star
20

cutorch-rtc

lua apply function for cutorch
Lua
17
star
21

idiap-tutorials

Jupyter Notebook
16
star
22

functional-style-transfer

minimal implementation of style transfer
Jupyter Notebook
10
star
23

nvrtc.torch

Torch7 bindings for CUDA NVRTC (runtime compilation) library
Lua
9
star
24

imi-demos

live convolutional neural networks demos
Python
9
star
25

cunn-rtc

Runtime compiled Torch cunn modules
Lua
8
star
26

clipp.torch

Torch interface to OpenCLIPP
C++
6
star
27

examples

Python
5
star
28

libclsvm

OpenCL optimized SVM library
C++
2
star
29

infimnist.torch

Torch7 InfiMNIST ffi binding
C
1
star