ImportError: No module named skimage
解决方法:采用*.deb方式来安装CUDA,不需要另外安装NVIDIA驱动(CUDA-7.0自带的就是最新的驱动),同时也不需关闭lightdm服务进入tty终端来安装。
在CUDA官网 https://developer.nvidia.com/cuda-downloads下载deb离线包安装即可。
【问题2】error: ‘CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING’ was not declared in this scope(安装cuDNN时,make 未声明错误)
In file included from ./include/caffe/util/device_alternate.hpp:40:0,
from ./include/caffe/common.hpp:19,
from ./include/caffe/util/math_functions.hpp:9,
from src/caffe/util/im2col.cpp:6:
./include/caffe/util/cudnn.hpp: In function ‘void caffe::cudnn::createPoolingDesc(cudnnPoolingStruct**, caffe::PoolingParameter_PoolMethod, cudnnPoolingMode_t*, int, int, int, int, int, int)’:
./include/caffe/util/cudnn.hpp:117:13: error: ‘CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING’ was not declared in this scope
*mode = CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING;
^
Makefile:510: recipe for target '.build_release/src/caffe/util/im2col.o' failed
make: *** [.build_release/src/caffe/util/im2col.o] Error 1
make: *** Waiting for unfinished jobs....
解决方法:原因是之前用cuDNN版本cudnn-6.5-linux-x64-R2-rc1.tgz过低,不适合当前的caffe版本,在cuDNN官网https://developer.nvidia.com/cuDNN注册下载目前最新的cuDNN版本cudnn-6.5-linux-x64-v2.tgz即可。
【问题3】Check failed: status == CUDNN_STATUS_SUCCESS (6 vs. 0) CUDNN_STATUS_ARCH_MISMATCH (make runtest 的check错误)
F0510 12:25:55.208068 9923 cudnn_softmax_layer.cpp:19] Check failed: status == CUDNN_STATUS_SUCCESS (6 vs. 0) CUDNN_STATUS_ARCH_MISMATCH
*** Check failure stack trace: ***
@ 0x7f13a97c7a0d google::LogMessage::Fail()
@ 0x7f13a97c98c0 google::LogMessage::SendToLog()
@ 0x7f13a97c75d2 google::LogMessage::Flush()
@ 0x7f13a97ca2de google::LogMessageFatal::~LogMessageFatal()
@ 0x7f13a63347a6 caffe::CuDNNSoftmaxLayer<>::LayerSetUp()
@ 0x7f13a633afad caffe::SoftmaxWithLossLayer<>::LayerSetUp()
@ 0x47d375 caffe::GradientChecker<>::CheckGradientExhaustive()
@ 0x51e078 caffe::SoftmaxWithLossLayerTest_TestGradientUnnormalized_Test<>::TestBody()
@ 0x74f923 testing::internal::HandleExceptionsInMethodIfSupported<>()
@ 0x747aba testing::Test::Run()
@ 0x747c08 testing::TestInfo::Run()
@ 0x747ce5 testing::TestCase::Run()
@ 0x748678 testing::internal::UnitTestImpl::RunAllTests()
@ 0x748943 testing::UnitTest::Run()
@ 0x44722a main
@ 0x7f13a5654a40 (unknown)
@ 0x44c409 _start
Makefile:465: recipe for target 'runtest' failed
make: *** [runtest] Aborted (core dumped)
解决方法:在cuDNN安装包中的INSTALL.txt可以看到
PREREQUISITES
CUDA 6.5 and a GPU of compute capability 3.0 or higher are required.
【问题4】/usr/bin/ld: cannot find -lopenblas
解决方法:
apt-get install libxxx-dev
这里,就直接修改Makefile中BLAS_INCLUDE和BLAS_LIB
# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
BLAS_INCLUDE := /opt/OpenBLAS/include
BLAS_LIB := /opt/OpenBLAS/lib
error: kernel launches from templates are not allowed in system files 1 error detected in the compilation of "/tmp/tmpxft_00005657_00000000-10_math_functions.cpp4.ii".
解决方法:
在Ubuntu14.04中会出现g++版本过高的问题,Ubuntu15.04则正常
sudo apt-get install gcc-4.6 g++-4.6 gcc-4.6-multilib g++-4.6-multilib
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
修改makefile,指定g++版本
CXX := /usr/bin/g++-4.6
./create_mnist.sh: 16: ./create_mnist.sh: build/examples/mnist/convert_mnist_data.bin: not found
解决方法:
新版caffe都需要从根目录上执行,不然可能会遇到这个错误
默认切换到了该工作目录 home/username/caffe-master,测试Caffe是否工作正常
$ sh data/mnist/get_mnist.sh % 数据预处理
$ sh examples/mnist/create_mnist.sh % 生成mnist-train-lmdb 和 mnist-train-lmdb文件夹,这里包含了lmdb格式的数据集
$ sh examples/mnist/train_lenet.sh % 训练mnist
【问题7】
在用pycaffe在做可视化时,出现如下错误
ImportError: No module named skimage
解决方法:
After installing cython , and then scikit-image.
pip install cython
pip install scikit-image