pycaffe config Solution References

There is always some trouble when we want use pycaffe and opencv at the same time 🙁

1
2
import caffe
import cv2

Solution

We just do not use Anaconda!!!!!

1
2
3
cd caffe/python
for req in $(cat requirements.txt); do pip install $req; done
pip install opencv-python
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os.path as osp
import sys

def (path):
if path not in sys.path:
sys.path.insert(0, path)

caffe_path = '/home/zhaoxiandong/caffe'


caffe_path = osp.join(caffe_path, 'python')
add_path(caffe_path)

import caffe
import cv2
# successful !::::))))

References

https://github.com/NVIDIA/DIGITS/issues/156