Skip to content

A simple Golang wrapper for caffe2 deep learning framework

License

Notifications You must be signed in to change notification settings

taufik-rama/caffe2-go-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caffe2 Golang Wrapper

Overview

Here's my attempt at wrapping Caffe2 C++ library with Golang CGO.

Note: Caffe2 is now a part of pytorch library, so we need to compile it from pytorch repository

Requirements

  • git
  • make
  • And other requirements for the Caffe2/Pytorch library & Intel MKL-DNN library.

Compiling

  • Clone the pytorch git repository & compile it.

    $ git clone https://github.com/pytorch/pytorch
    # Cloning...
    $ cd pytorch
    $ git checkout v1.0.1 # I currently test using this version
    # Compile it
  • (Depends on the pytorch build flags) Clone the mkl-dnn git repository & get the external header files.

    $ https://github.com/intel/mkl-dnn
    # Cloning...
    $ cd mkl-dnn
    $ git checkout v0.18.1 # I currently test using this version
    # Compile it
  • Clone this repository.

    $ git clone --depth=1 https://github.com/taufik-rama/caffe2-go-binding
    # Cloning...
  • Copy all of the torch package include file (should be on torch/lib/include/) into caffe2/include-pytorch/

    # On pytorch directory after compilation
    $ cp -r torch/lib/include/* /path/to/caffe2/include-pytorch/
  • Copy libc10.so & libcaffe2.so from pytorch build result (should be on build/lib/) into caffe2/lib/ directory.

    # On pytorch directory after compilation
    $ cp build/lib/libc10.so build/lib/libcaffe2.so /path/to/caffe2/lib/
  • Copy all of the mkl-dnn external header file (should be on external/mkl{xx}/include/) into caffe2/include-mkl

    # On pytorch directory after compilation
    $ cp external/mkl{xx}/include/* /path/to/caffe2/include-mkl/
  • Compile the C project

    $ cd caffe2 && make
    # Compiling...
  • Build the Go package normally

    $ go build
    # Compiling...

About

A simple Golang wrapper for caffe2 deep learning framework

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published