Caffe2

conda install instructions

ref:https://caffe2.ai/docs/getting-started.html?platform=mac&configuration=compile#anaconda-install-path

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Create a conda environment 
conda create -n caffe2 python=2 && source activate caffe2
# Install required packages
# mkl isn't actually required, but is really recommended for Anaconda
conda install -y 
    future 
    gflags 
    glog 
    lmdb 
    mkl 
    mkl-include 
    numpy 
    opencv 
    protobuf 
    snappy 
    six
# Clone Caffe2
cd ~ && git clone --recursive https://github.com/caffe2/caffe2.git && cd caffe2

# Make Caffe2 in a separate folder to avoid polluting the Caffe2 source tree.
# This can be anywhere you want it
mkdir build && cd build

# Add flags to this command to control which packages you want to use. The
# options to use are at the top of CMakeLists.txt in the topmost Caffe2
# directory
# /usr/bin/miniconda3/envs/python2
cmake -DUSE_CUDA=OFF -DUSE_LEVELDB=OFF -DCMAKE_PREFIX_PATH=/path-to-conda/envs/my_caffe2_env -DCMAKE_INSTALL_PREFIX=/path-to-conda/envs/my_caffe2_env 

cmake -DUSE_CUDA=OFF -DUSE_LEVELDB=OFF -DCMAKE_PREFIX_PATH=/usr/bin/miniconda3/envs/python2 -DCMAKE_INSTALL_PREFIX=/usr/bin/miniconda3/envs/python2
..
sudo make install

install log

  • dev-127:
    use conda env:my_caffe2_env, python2.7
    build ok~~

1
2
3
conda create -n my_caffe2_env python=2
source activate my_caffe2_env
source decativate my_caffe2_env

write sripts to switch caffe2 env, named caffe2-env.sh under home dir

  • virtural-220:
    env-name=python2

tutarial log

  • dot not found in path
1
2
3
4
pip install graphviz
pip install gprof2dot
pip install pygraphviz
apt install graphviz # finally fixed!!