1、 import caffe FAILED
环境为 Ubuntu 16 cuda 8.0 NVIDIA 361.77 Anaconda2。昨天莫名其妙Caffe不能用了:?
1 2 3 4 5 6 7 8 | >>>
Stream Vera Sans Mono', 'Courier New', Courier, monospace !important; FLOAT: none !important; BORDER-TOP-WIDTH: 0px !important; BORDER-BOTTOM-WIDTH: 0px !important; HEIGHT: auto !important; COLOR: rgb(0,102,153) !important; CLEAR: both; VERTICAL-ALIGN: baseline !important; OVERFLOW: visible !important; TOP: auto !important; RIGHT: auto !important; FONT-WEIGHT: bold !important; PADDING-TOP: 0px; LEFT: auto !important; border-radius: 0px; border-image-source: initial; border-image-slice: initial; border-image-width: initial; border-image-outset: initial; border-image-repeat: initial; background-size: initial; background-origin: initial; background-clip: initial" class="py keyword">import caffe Traceback
(most recent call last): File "<stdin>" , line
1 , in <module> File "/home/duchengyao/project/caffe/python/caffe/__init__.py" , line
1 , in <module> from .pycaffe
import Net,
SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver,
AdamSolver File "/home/duchengyao/project/caffe/python/caffe/pycaffe.py" , line
13 , in <module> from ._caffe
import Net,
SGDSolver, NesterovSolver, AdaGradSolver, ImportError:
/ home / duchengyao / project / caffe / python / caffe / .. / .. / build / lib / libcaffe.so. 1.0 . 0 - rc3: undefined
symbol:
_ZN2cv8imencodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11_InputArrayERSt6vectorIhSaIhEERKSB_IiSaIiEE |
各种折腾都无效,重装Anaconda以后错误消失,import caffe 成功。2、 import FAILED again after “$conda install opencv”用 conda install opencv 安装完Opencv后,又出现了同样的错误提示,卸载后错误消失。Conda 安装后的Opencv 版本为2.4.10,而系统apt安装的版本为2.4.9.1。我尝试从conda 安装2.4.9版,可是需要处理很多conflict。最后实在走投无路了准备换成Anaconda3,环境搭建完成后运行程序的时候简直尴尬了,各种库不兼容。终于知道为啥老鸟们调侃Python 跟Python3完全是两种语言了3、 解决方案暂时的解决方案为放弃anaconda,全部用apt安装软件包,使用系统默认的Opencv,运行成功。