总结一下,留备用
question1:
File"setup.py", line 10, in
from setuptools import setup
ImportError:No module named setuptools
make:*** [all] Error 1
solution1:
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
tar zxvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python setup.py build
python setup.py install
question2: File "setup.py", line 12, in
from Cython.Distutils import build_ext
ImportError:No module named Cython.Distutils
make:*** [all] Error 1
solution2:
在Ubuntu14.04上,建议通过下面的方法安装,这是一种通用的方法,
手动下载下来就行了
wgethttps://bootstrap.pypa.io/get-pip.py --no-check-certificate
sudo python get-pip.py
sudo pip install cython
(add q2:
sudo python get-pip.py
error:
pip isconfigured with locations that require TLS/SSL, however the ssl module inPython is not available.
Collecting pip
Could not fetch URL https://pypi.python.org/simple/pip/: There was aproblem confirming the ssl certificate: Can't connect to HTTPS URL because theSSL module is not available. - skipping
Could not find a version that satisfies the requirement pip (fromversions: )
No matching distribution foundfor pip )
(solution add2:
Sudo reboot 重新输入就可以,应该是后台有程序占用,kill也可以。
)
question3:
File "setup.py", line14, in
import numpy as np
ImportError: No module namednumpy
make: *** [all] Error 1
solution3:
sudo apt-get installpython-numpy
question4:
x86_64-linux-gnu-gcc: error:utils/bbox.c: No such file or directory
x86_64-linux-gnu-gcc: fatalerror: no input files
compilation terminated.
error: command 'x86_64-linux-gnu-gcc'failed with exit status 4
make: *** [all] Error 1
solution4:
cd $FRCN_ROOT/lib/utils
cython bbox.pyx
question5:
x86_64-linux-gnu-gcc:error: nms/cpu_nms.c: No such file or directory
x86_64-linux-gnu-gcc:fatal error: no input files
compilationterminated.
error: command'x86_64-linux-gnu-gcc' failed with exit status 4
make: *** [all] Error1
solution5:
手动用cython生成cpu_nms.c
cd $FRCN_ROOT/lib/nms
cython cpu_nms.pyx
quetions6:
x86_64-linux-gnu-gcc:error: pycocotools/_mask.c: No such file or directory
x86_64-linux-gnu-gcc:fatal error: no input files
compilationterminated.
error: command'x86_64-linux-gnu-gcc' failed with exit status 4
make: *** [all] Error1
solution6:
手动用cython生成_mask.c
cd $FRCN_ROOT/lib/pycocotools
cython _mask.pyx
question7:
make: ***[.build_release/src/caffe/util/benchmark.o] Error 1
In file included from./include/caffe/util/device_alternate.hpp:40:0,
from./include/caffe/common.hpp:19,
from./include/caffe/blob.hpp:8,
from./include/caffe/layer.hpp:8,
fromsrc/caffe/layer_factory.cpp:8:
./include/caffe/util/cudnn.hpp:5:19:fatal error: cudnn.h: No such file or directory
solution7:
CuDNN是专门针对Deep Learning框架设计的一套GPU计算加速方案,目前支持的DL库包括Caffe,ConvNet, Torch7等。
CuDNN可以在官网免费获得,注册帐号后即可下载。官网没有找到安装说明,下载得到的压缩包内也没有Readme. 不过google一下就会找到许多说明。基本原理是把lib文件加入到系统能找到的lib文件夹里, 把头文件加到系统能找到的include文件夹里就可以。这里把他们加到CUDA的文件夹下(参考这里)
tar-xzvf cudnn-6.5-linux-R1.tgz
cd cudnn-6.5-linux-R1
sudocp lib* /usr/local/cuda/lib64/
sudo cp cudnn.h /usr/local/cuda/include/
http://www.unjeep.com/q/894288692.html
question8:
opencv编程中undefined reference to 'cv::dft':
./obj/local/armeabi/libopencv_imgproc.a(templmatch.cpp.o):In function `cv::crossCorr(cv::Mat const&,cv::Mat const&,cv::Mat&, cv::Size_
templmatch.cpp:(.text+0x47e): undefined reference to`cv::getOptimalDFTSize(int)'
templmatch.cpp:(.text+0x494): undefined reference to `cv::getOptimalDFTSize(int)'
templmatch.cpp:(.text+0x92c): undefined reference to`cv::dft(cv::_InputArray const&,cv::_OutputArray const&, int, int)'
templmatch.cpp:(.text+0xfa4): undefined reference to`cv::dft(cv::_InputArray const&,cv::_OutputArray const&, int, int)'
templmatch.cpp:(.text+0x1006): undefined reference to`cv::mulSpectrums(cv::_InputArray const&,cv::_InputArray const&,cv::_OutputArray const&, int, bool)'
templmatch.cpp:(.text+0x102e): undefined reference to`cv::dft(cv::_InputArray const&,cv::_OutputArray const&, int, int)'
solution8:
add"opencv_imgcodecs" in Makefile.(LIBRARIES += glog gflags protobufleveldb snappy \
lmdb boost_system hdf5_hl hdf5 m \
opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs)
If you input "make all",the problem is the same again.But if youdelete all the file in build(rm -rf ./build/*) before "make all"(Iuse make clean ),you will success.I just success
quesiton9:
AR-o .build_release/lib/libcaffe.a
LD-o .build_release/lib/libcaffe.so.1.0.0-rc3
/usr/bin/ld:cannot find -l -lboost_system
/usr/bin/ld:cannot find -lhdf5 -lopencv_core
collect2:error: ld returned 1 exit status
make:*** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
solution9:
1.系统缺乏对应的库文件;
2.版本不对应;
3.库文件的链接错误;
4.库文件路径设置问题。
对应第一第二种情况,可以通过下载安装lib来解决,ubuntu大多数可以直接通过apt-get来安装:
apt-getinstall libxxx-dev
一般遇到这种问题笔者第一时间也是会去检查系统是否已安装该lib或者是否已选择正确版本(只是习惯问题),如果还是不能解决问题,那么,引起错误的原因不是链接错误就是库文件路径问题了。
通过find或者locate指令定位到链接文件,查看链接文件是否正确的指向了我们希望的lib,如果不是,用 ln -s */libxxx.so.x */libxxx.so 指令修改它。
Importcaffe时错误提示
1.错误提示:ImportError: No modulenamed skimage.io
解决方法:
直接使用终端安装:
pip install -U scikit-image
如果提示不识别 pip 命令,在Ubuntu14.04(64bit)下,使用下面命令安装pip包管理软件,也可以使用新立得软件包搜索“scikit-image”安装。
wgethttps://bootstrap.pypa.io/get-pip.py --no-check-certificate
sudo python get-pip.py
question10:
ImportError: No module namedgoogle.protobuf.internal
提示错误可使用新立得软件包搜索“python-protobuf”安装。
然后使用import caffe测试接口是否调试成功。
Question11:
ImportError:No module named easydict
解决方法:
sudo pip install easydict
question12:
错误描述: 当在$FRCN_ROOT/lib下make时出现
Traceback(most recent call last):
File “./demo.py”, line 18, in module
from fast_rcnn.test import im_detect
File “/home/lijiajun/py-faster-rcnn-blog/tools/../lib/fast_rcnn/test.py”, line17, in module
from fast_rcnn.nms_wrapper import nms
File“/home/lijiajun/py-faster-rcnn-blog/tools/../lib/fast_rcnn/nms_wrapper.py”,line 9, in module
from nms.gpu_nms import gpu_nms
ImportError: /home/lijiajun/py-faster-rcnn-blog/tools/../lib/nms/gpu_nms.so:undefined symbol: _nms
Solution 12:
编辑setup.py
cd $FRCN_ROOT/lib
vim setup.py
将gpu_nms.pyx改为gpu_nms.cpp
#before
Extension('nms.gpu_nms',
['nms/nms_kernel.cu', 'nms/gpu_nms.pyx'],
...
#after
Extension('nms.gpu_nms',
['nms/nms_kernel.cu', 'nms/gpu_nms.cpp'],
修改gpu_nms.c文件后缀为.cpp
cd $FRCN_ROOT/lib/nms
mv gpu_nms.c gpu_nms.cpp
rm gpu_nms.so