Caffe + CUDA8.0 + CuDNNv5.1 + OpenCV3.1 + Ubuntu14.04 配置参考文献 ---- Wang Xiao Anhui University CVP
Warning: Please make sure the cuda is installed correctly, before you reboot your PC, or? you may stucked and can not open your system.
Check in your terminal: nvidia-smi
If it shown you the following image, it means you have successfully installed cuda and you can reboot your PC safely.
wangxiao@AHU:~$ nvidia-smi
Sun Jul 24 13:53:05 2016????? ?
+------------------------------------------------------+????????????????????? ?
| NVIDIA-SMI 352.63???? Driver Version: 352.63???????? |????????????????????? ?
|-------------------------------+----------------------+----------------------+
| GPU? Name??????? Persistence-M| Bus-Id??????? Disp.A | Volatile Uncorr. ECC |
| Fan? Temp? Perf? Pwr:Usage/Cap|???????? Memory-Usage | GPU-Util? Compute M. |
|===============================+======================+======================|
|?? 0? GeForce GTX 960M??? Off? | 0000:01:00.0???? Off |????????????????? N/A |
| N/A?? 46C??? P8??? N/A /? N/A |??? 204MiB /? 2047MiB |????? 0%????? Default |
+-------------------------------+----------------------+----------------------+
????????????????????????????????????????????????????????????????????????????? ?
+-----------------------------------------------------------------------------+
| Processes:?????????????????????????????????????????????????????? GPU Memory |
|? GPU?????? PID? Type? Process name?????????????????????????????? Usage????? |
|=============================================================================|
|??? 0????? 1198??? G?? /usr/bin/X???????????????????????????????????? 159MiB |
|??? 0????? 2025??? G?? compiz????????????????????????????????????????? 37MiB |
+-----------------------------------------------------------------------------+
wangxiao@AHU:~$
Install CUDA until this appeared in your screen?!
Q1: Some times, it warning you that your Nvidia-driver can not communitcate with your GPU, what can you do ??
A1: Well, the only thing you could do is install your cuda in the right way, and reboot your PC. It will be OK. ?
??
1. 首先安裝 cuda :
sudo apt-get update
sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb
sudo apt-get install cuda
2. 安裝基本依賴項:
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler sudo apt-get install --no-install-recommends libboost-all-devsudo?apt-get?install?libprotobuf-dev?libleveldb-dev?libsnappy-dev?libopencv-dev?libhdf5-serial-dev?protobuf-compiler???sudo?apt-get?install?--no-install-recommends?libboost-all-dev
?sudo?apt-get?install?python-skimage?ipython?python-pil?python-h5py?ipython?python-gflags?python-yaml ?
?sudo?apt-get?install?libgflags-dev?libgoogle-glog-dev?liblmdb-dev ?
3. 設置環境變量:
export PATH=/usr/local/cuda-8.0/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH也可以在 /etc/profile中進行編輯,?在最后加入:
exportPATH=/usr/local/cuda-8.0/bin:$PATH exportLD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH4. 設置CUDA-7.5 SAMPLES:
cuda-install-samples-8.0.sh ~ cd ~/NVIDIA_CUDA-8.0_Samples cd 1_Utilities/deviceQuery make進入NVIDIA_CUDA-8.0_Samples 會編譯很長時間,耐心等待。
執行測試代碼: deviceQuery,如果成功結尾會是Result = PASS
此處,可能因為gcc或者g++版本問題,導致無法編譯。重新安裝一個較老的版本gcc-4.7,然后添加對應的軟連接即可編譯:?
sudo apt-get install -y gcc-4.7 sudo apt-get install -y g++-4.7 cd /usr/bin sudo rm gcc sudo ln -s gcc-4.7 gcc sudo rm g++ sudo ln -s g++-4.7 g++ #### check it's success or not ? ls -al gcc g++ gcc --version g++ --version如何安裝多個版本的 gcc 和 g++,然后實現自動切換?
?
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt updatesudo update-alternatives --remove-all gcc sudo update-alternatives --remove-all g++ sudo apt-get install -y gcc-4.8 g++-4.8 gcc-4.9 g++-4.9 gcc-5 g++-5 gcc-6 g++-6 gcc-7 g++-7sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 30 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 40 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 50sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 30 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 40 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 50sudo update-alternatives --set cc /usr/bin/gcc sudo update-alternatives --set c++ /usr/bin/g++?
?
?
?
如果需要 gcc 3.4.6,還可以安裝這2個包:?
gcc34?https://drive.google.com/file/d/0B7S255p3kFXNRTkzQnRSNXZ6UVU/view?usp=sharing?
g++34?https://drive.google.com/file/d/0B7S255p3kFXNV3J3bnVoWGNWdG8/view?usp=sharing?
下載后用 sudo dpkg -i package_name 安裝,然后執行:
?
切換命令:
sudo update-alternatives --config gcc sudo update-alternatives --config g++?
5. 安裝BLAS:
sudo apt-get install libatlas-base-dev6. 安裝其他依賴項:
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev7. 安裝opencv:
#[compiler] sudo apt-get install build-essential #[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev #[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev8. 安裝cudnn:?
解壓cudnn的包(官網得申請,用網盤搜索能找到最新的),有include和lib64,里面文件復制到對應/usr/local/cuda/對應文件夾里
#進到對應文件夾 sudo cp cudnn.h /usr/local/cuda/include/ #進到對應文件夾 sudo cp lib* /usr/local/cuda/lib64/ #進行一次 sudo ldconfig -v9. 安裝caffe:
Caffegit clone https://github.com/BVLC/caffe.git cp Makefile.config.example Makefile.config 修改Makefile.config,去掉cudnn的注釋,其他的在當前應用場景可不變。make all make test make runtest10. 安裝matlab:
Many Tutorials online, we just ignore this part here.?
11. can not find "hdf5.h":
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include?? /usr/include/hdf5/serial ?
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib? /usr/lib/x86_64-linux-gnu/hdf5/serial
?
12. 編譯caffe的時候,提示:
CXX examples/cifar10/convert_cifar_data.cpp
CXX examples/siamese/convert_mnist_siamese_data.cpp
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
Makefile:563: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
wangxiao@GTX980:~/Downloads/caffe-master$
-------------------
怎么破?
do as issue 12. Change the Makefile.config:?
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include???/usr/include/hdf5/serial ?
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib??/usr/lib/x86_64-linux-gnu/hdf5/serial
?
?13. 安裝 MKL:
?
+ View Code
?
?
?15. 可能需要添加的東西:
配置Makefile文件(實現對OpenCV3.x的支持)查找“Derive include and lib directories”一節,修改“LIBRARIES +=”的最后一行,增加opencv_imgcodecsopencv_core opencv_highgui opencv_imgproc opencv_imgcodecs?16. 運行caffe案例:
1. 數據預處理$ sudo shdata/mnist/get_mnist.sh2. 重建lmdb文件。Caffe支持三種數據格式輸入網絡,包括Image(.jpg, .png等),leveldb,lmdb,根據自己需要選擇不同輸入吧。$sudo shexamples/mnist/create_mnist.sh生成mnist-train-lmdb 和 mnist-train-lmdb文件夾,這里包含了lmdb格式的數據集注:我執行此命令的時候報告說not in gzformat,后來發現是聯網下載的mnist數據有問題,然后我就去網上了下載了mnist數據集,后在ubuntu上手動解壓的,再執行后面的命令。3. 訓練mnist $ sudo shexamples/mnist/train_lenet.sh?17. when compile caffe:
View Code
what the fuck :::
...
?
OK, 改為ubuntu Kylic版本了,哎,還是麒麟好用啊。。。坑逼
?
18. when use the matlab demo from caffe file:
after make matcaffe, and it warning me it's OK. and when run the demo, it shown me the errors like this:
Invalid MEX-file '/home/wangxiao/Downloads/caltech_256_caffe_master/matlab/+caffe/private/caffe_.mexa64': libcudart.so.7.5: cannot open shared object file: No such file or?directory?
What should I do for this ??
You must remember the following operation, because it really worked well ! Yeah !!!
?
error while loading shared libraries: libcudart.so.7.5: cannot open shared object file: No such file or directory
32-bit:? ?sudo ldconfig /usr/local/cuda/lib
64-bit:? ?sudo ldconfig /usr/local/cuda/lib64
?
今天悲劇的發現, 執行了 64-bit 之后出現錯誤:
wangxiao@AHU:~/Downloads/caffe-master$ sudo ldconfig /usr/local/cuda/lib64
/sbin/ldconfig.real: /usr/local/cuda/lib64/libcudnn.so.5 is not a symbolic link
不知道問題何在啊?怎么解決???
################################################ 有時候需要更新軟鏈接:cd /usr/local/cuda/lib64/ ?sudo rm -rf libcudnn.so libcudnn.so.7.5 ?sudo ln -s libcudnn.so.7.5.48 libcudnn.so.7.5 ?sudo ln -s libcudnn.so.7.5 libcudnn.so???
19. When compile caffe, some times it always shown you a mistake like this:
CXX src/caffe/util/db_leveldb.cpp
In file included from src/caffe/util/signal_handler.cpp:7:0:
./include/caffe/util/signal_handler.h:4:34: fatal error: caffe/proto/caffe.pb.h: No such file or directory
#include "caffe/proto/caffe.pb.h"
^
compilation terminated.
The bug is not reproducible, so it is likely a hardware or OS problem.
make: *** [.build_release/src/caffe/util/signal_handler.o] Error 1
make: *** Waiting for unfinished jobs....
^Cmake: *** [.build_release/src/caffe/util/math_functions.o] Interrupt
make: *** [.build_release/src/caffe/net.o] Interrupt
make: *** wait: No child processes. Stop.
?
Do you how to solve this problem ??? ?Just becase the lost of the file : caffe.pb.h, and this file is actually generated from the process of compile. Do the following operation will help you solve the problem:
Just input make in your terminal: ?make?
Then, press ctrl+c to stop it, and input: make -j8?
All process will be normal now !
Here is a figure to help you understand this all process.
?20. You also maybe meet a error like this:
+ View Code
Just add a word in you Makefile,?following:
| 1 | LIBRARIES += opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs |
?
21. 利用caffe 的matlab借口提取feature的時候:碰到了這個問題:怎么破 ?
Undefined function 'caffe_' for input arguments of type 'char'.
Error in caffe.set_mode_gpu (line 5)
caffe_('set_mode_gpu');
Error in Copy_of_Label_all_ (line 11)
caffe.set_mode_gpu();
?
答:因為沒有編譯matlab接口,即:make matcaffe 執行這句,完了之后,你就發現,yeah,可以了。。。
?
22. protobuf 的下載與安裝
from:?https://github.com/protocolbuffers/protobuf/tree/master/src
?
You can get the source by "git clone" our git repository. Make sure you have also cloned the submodules and generated the configure script (skip this if you are using a release .tar.gz or .zip package):$ git clone https://github.com/protocolbuffers/protobuf.git $ cd protobuf $ git submodule update --init --recursive $ ./autogen.sh To build and install the C++ Protocol Buffer runtime and the Protocol Buffer compiler (protoc) execute the following:$ ./configure $ make $ make check $ sudo make install $ sudo ldconfig # refresh shared library cache.?
?
?
23. 將 wide residual network 的 python 腳本生成 其對應的 protext 文件,出現問題:
wangxiao@AHU:~/Downloads/caffe-master$ python ./python/wide_residual_network.py
Traceback (most recent call last):
File "./python/wide_residual_network.py", line 62, in <module>
make_net(tgt_file)
File "./python/wide_residual_network.py", line 58, in make_net
print(resnet_cifar(depth=16, widen_factor=8), file=f)
File "./python/wide_residual_network.py", line 53, in resnet_cifar
return to_proto(loss, acc)
File "/home/wangxiao/Downloads/caffe-master/python/caffe/net_spec.py", line 50, in to_proto
top.fn._to_proto(layers, {}, autonames)
--------------------- 類似這種轉換 ------- 此處略寫 -----------------------
inp._to_proto(layers, names, autonames)
File "/home/wangxiao/Downloads/caffe-master/python/caffe/net_spec.py", line 97, in _to_proto
return self.fn._to_proto(layers, names, autonames)
File "/home/wangxiao/Downloads/caffe-master/python/caffe/net_spec.py", line 136, in _to_proto
inp._to_proto(layers, names, autonames)
AttributeError: 'NoneType' object has no attribute '_to_proto'
wangxiao@AHU:~/Downloads/caffe-master$
?
?搜到一個答案,但是不知所云:
http://stackoverflow.com/questions/15232832/python-regex-attributeerror-nonetype-object-has-no-attribute-groups
哎 坑啊 ...
?
24. 要用 CUDNN,因為訓練速度會提升好幾倍!!!
?
25. 編譯 caffe 出現:
XX src/caffe/layers/cudnn_sigmoid_layer.cpp
CXX src/caffe/layers/deconv_layer.cpp
src/caffe/net.cpp:8:18: fatal error: hdf5.h: No such file or directory
#include "hdf5.h"
^
compilation terminated.
Makefile:572: recipe for target '.build_release/src/caffe/net.o' failed
make: *** [.build_release/src/caffe/net.o] Error 1
make: *** Waiting for unfinished jobs....
wangxiao@csdl:~/pedestrian_attributes/43_attribute_caffe_master_$ ^C
wangxiao@csdl:~/pedestrian_attributes/43_attribute_caffe_master_$
?那么,怎么解決這個問題?添加兩行路徑:
? /usr/include/hdf5/serial?
/usr/lib/x86_64-linux-gnu/hdf5/serial
?
?26. caffe 配置 python 環境變量:?參考博文:http://blog.csdn.net/yingyujianmo/article/details/51014440
?
添加環境變量?
vim ~/.bashrc
將export PYTHONPATH=/home/wanghh/caffe/python:$PYTHONPATH添加到文件中。?
source ~/.bashrc
這樣,在其他地方打開python,也可以import caffe了。
?
?
?
27. caffe 配置 python, some times, it shown us: no module named caffe:?
at this moment, maybe you should add those codes into your file, like :
then, you can check it again. It will be OK.?
?
28. when install new softwares, I find this error:?
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
kate : Depends: kdelibs4c2a (>= 4:3.5.9) but it is not going to be installed
Depends: libqt3-mt (>= 3:3.3.8b) but it is not going to be installed
Recommends: kregexpeditor but it is not installable
kscope : Depends: kdelibs4c2a (>= 4:3.5.7-1) but it is not going to be installed
Depends: libaudio2 but it is not going to be installed
Depends: libqt3-mt (>= 3:3.3.8really3.3.7) but it is not going to be installed
Depends: cscope but it is not going to be installed
Depends: exuberant-ctags but it is not going to be installed
Depends: graphviz but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).?
?
try this operation on the terminal, it will solve this issue:?
==>> $: apt-get -f install ? ?
?
29. when compile matconvnet, it shown me error like this:?
+ View Code
==>> Update your MatConvnet version. It indeed contain such errors in this version.?
?
30.?json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array escape?
when compile caffe file in SSD, it shown me the error like this:?
json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array escape?
Just like this blog said, you need do this:?
?
修改json_parser_read.hpp:打開文件夾Document,選中computer,在搜索json_parser_read.hpp,找到該文件的路徑之后用如下命令打開
?
sudo gedit /usr/include/boost/property_tree/detail/json_parser_read.hpp?
將257行開始的escape代碼段注釋掉即可,如下:
?
/*escape= chset_p(detail::widen<Ch>("\"\\/bfnrt").c_str())[typename Context::a_escape(self.c)]| 'u' >> uint_parser<unsigned long, 16, 4, 4>()[typename Context::a_unicode(self.c)];*/?
?
31. ?ImportError: No module named caffe.proto
wangxiao@AHU:~/Documents/caffe$ ./data/VOC0712/create_data.sh
Traceback (most recent call last):
File "/home/wangxiao/Documents/caffe/data/VOC0712/../../scripts/create_annoset.py", line 7, in <module>
from caffe.proto import caffe_pb2
ImportError: No module named caffe.proto
Traceback (most recent call last):
File "/home/wangxiao/Documents/caffe/data/VOC0712/../../scripts/create_annoset.py", line 7, in <module>
from caffe.proto import caffe_pb2
ImportError: No module named caffe.proto?
?
Solution: ??export PYTHONPATH=/home/wangxiao/Documents/caffe/python:$PYTHONPATH?
then, run:?./data/VOC0712/create_data.sh ?
it will be OK.?
?
32. ImportError: No Module named caffe:
import sys
sys.path.append("/(你的caffe-master路徑)/caffe-master/python")
sys.path.append("/(你的caffe-master路徑)/caffe-master/python/caffe") ?
?
33. OpenCV Error:?
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /io/opencv/modules/highgui/src/window.cpp, line 583 Traceback (most recent call last): ? File "./show_tracker_vot.py", line 30, in <module> ? ? objTrackerVis.trackAll(0, 1) ? File "/home/wangxiao/Downloads/goTURN-tensorflow/PY-GOTURN-master/src/tracker_manager.py", line 55, in trackAll ? ? cv2.imshow('input', sMatImage) cv2.error: /io/opencv/modules/highgui/src/window.cpp:583: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage ?
==>> do the following opeartions:?
| 1 2 3 4 5 6 7 8 9 10 | 1.Remove installed OpenCV version to avoid mess up later ? pip3 uninstall opencv-python 2.Lower you python version to 3.5(current version 3.6 has different problems with conda, which we will use to install OpenCV) ? conda install python=3.5 3.Finally use conda, to install working version of OpenCV ? conda install -c menpo opencv3? sudo apt-get install libgtk-3-dev |
?
34. when running a tensorflow code, it shown me a error:?
ImportError: libcudnn.so.6: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
==>> well, this is because the version of tensorflow. Currently, the most recent tensorflow is version 1.3.0, and it need cudnn v6+. but my machine still use the cudnn v5.1.?
Thus the error occured. You can sovle this problem by install tensorflow v1.2.0, as following:
| 1 | sudo pip install --user tensorflow==1.2.0 |
35. How to install keras with specific version, not the newest one ?????
| 1 | sudo pip install keras==1.2 |
36.?ankit@Ankit:~/caffe$ make all
CXX/LD -o .build_release/tools/convert_imageset.bin
.build_release/lib/libcaffe.so: undefined reference to?cv::imread(cv::String const&, int)' .build_release/lib/libcaffe.so: undefined reference tocv::imencode(cv::String const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator >&, std::vector<int, std::allocator > const&)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_imageset.bin] Error 1?
Solution:?
?
| 1 2 3 | 1. add "opencv_imgcodecs" in Makefile.(opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs) ? 2. delete all the file in build(rm -rf ./build/*) before "make all". |
?
37. new issues about new version of cuda:??
CXX src/caffe/parallel.cpp
NVCC src/caffe/solvers/adadelta_solver.cu
nvcc fatal : Unsupported gpu architecture 'compute_20'
Makefile:576: recipe for target '.build_release/cuda/src/caffe/solvers/adadelta_solver.o' failed
make: *** [.build_release/cuda/src/caffe/solvers/adadelta_solver.o] Error 1
make: *** 正在等待未完成的任務....
==>> SOlution: from:?https://askubuntu.com/questions/960238/nvcc-fatal-unsupported-gpu-architecture-compute-20??
?
38. when compile caffe on our linux server, following errors occured:?
/usr/include/c++/7/bits/exception_ptr.h(90): error: use of a local type to declare a function
/usr/include/c++/7/bits/exception_ptr.h(90): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(91): error: use of a local type to declare a function
/usr/include/c++/7/bits/exception_ptr.h(93): error: namespace "__cxxabiv1::std" has no member "make_exception_ptr"
/usr/include/c++/7/bits/exception_ptr.h(93): error: a template friend declaration cannot be declared in a local class
/usr/include/c++/7/bits/exception_ptr.h(93): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(96): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(98): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(101): error: incomplete type is not allowed
/usr/include/c++/7/bits/exception_ptr.h(101): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(122): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(132): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(149): error: use of a local type to declare a function
/usr/include/c++/7/bits/exception_ptr.h(150): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(153): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(158): error: use of a local type to declare a function
/usr/include/c++/7/bits/exception_ptr.h(159): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(162): error: use of a local type to declare a function
/usr/include/c++/7/bits/exception_ptr.h(163): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(166): error: use of a local type to declare a function
/usr/include/c++/7/bits/exception_ptr.h(167): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(179): error: expected a ";"
/usr/include/c++/7/bits/exception_ptr.h(214): error: expected a ";"
/usr/include/c++/7/bits/move.h(46): error: identifier "constexpr" is undefined
/usr/include/c++/7/bits/move.h(46): error: "_Tp" is not a function or static data member
/usr/include/c++/7/bits/move.h(51): error: expected a ";"
/usr/include/c++/7/type_traits(71): error: identifier "constexpr" is undefined
/usr/include/c++/7/type_traits(71): error: template parameter "_Tp" may not be redeclared in this scope
/usr/include/c++/7/type_traits(71): error: expected a ";"
/usr/include/c++/7/type_traits(72): error: member "__cxxabiv1::std::integral_constant<_Tp, __v>::_Tp" is not a type name
/usr/include/c++/7/type_traits(73): error: member "__cxxabiv1::std::integral_constant<_Tp, __v>::_Tp" is not a type name
/usr/include/c++/7/type_traits(74): error: identifier "constexpr" is undefined
/usr/include/c++/7/type_traits(74): error: expected a ";"
/usr/include/c++/7/type_traits(84): error: identifier "constexpr" is undefined
/usr/include/c++/7/type_traits(84): error: "_Tp" is not a function or static data member
/usr/include/c++/7/type_traits(93): error: expected a declaration
/usr/include/c++/7/type_traits(93): error: expected a ";"
/usr/include/c++/7/type_traits(126): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)
/usr/include/c++/7/type_traits(154): error: __bool_constant is not a template
/usr/include/c++/7/type_traits(154): error: not a class or struct name
/usr/include/c++/7/type_traits(245): error: identifier "char16_t" is undefined
/usr/include/c++/7/type_traits(249): error: identifier "char32_t" is undefined
/usr/include/c++/7/type_traits(249): error: class "__cxxabiv1::std::__is_integral_helper<<error-type>>" has already been defined
/usr/include/c++/7/type_traits(362): error: namespace "__cxxabiv1::std" has no member "size_t"
/usr/include/c++/7/type_traits(463): error: expected a ">"
/usr/include/c++/7/type_traits(467): error: expected a ">"
/usr/include/c++/7/type_traits(475): error: expected a ">"
/usr/include/c++/7/type_traits(479): error: expected a ">"
/usr/include/c++/7/type_traits(487): error: expected a ">"
/usr/include/c++/7/type_traits(491): error: expected a ">"
/usr/include/c++/7/type_traits(499): error: expected a ">"
/usr/include/c++/7/type_traits(503): error: expected a ">"
/usr/include/c++/7/type_traits(511): error: expected a ">"
/usr/include/c++/7/type_traits(515): error: expected a ">"
/usr/include/c++/7/type_traits(523): error: expected a ">"
/usr/include/c++/7/type_traits(527): error: expected a ">"
/usr/include/c++/7/type_traits(535): error: expected a ">"
/usr/include/c++/7/type_traits(539): error: expected a ">"
/usr/include/c++/7/type_traits(547): error: expected a ">"
/usr/include/c++/7/type_traits(551): error: expected a ">"
/usr/include/c++/7/type_traits(561): error: namespace "__cxxabiv1::std" has no member "nullptr_t"
/usr/include/c++/7/type_traits(582): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)
/usr/include/c++/7/type_traits(588): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)
/usr/include/c++/7/type_traits(595): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)
/usr/include/c++/7/type_traits(602): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)
/usr/include/c++/7/type_traits(612): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)
/usr/include/c++/7/type_traits(638): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)
/usr/include/c++/7/type_traits(748): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)
/usr/include/c++/7/type_traits(762): error: expected a ";"
/usr/include/c++/7/type_traits(777): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)
/usr/include/c++/7/type_traits(787): error: expected a ")"
/usr/include/c++/7/type_traits(798): error: an explicit template argument list is not allowed on this declaration
/usr/include/c++/7/type_traits(798): error: expected a type specifier
/usr/include/c++/7/type_traits(798): error: function returning function is not allowed
/usr/include/c++/7/type_traits(798): error: expected a ";"
/usr/include/c++/7/type_traits(804): error: space required between adjacent ">" delimiters of nested template argument lists (">>" is the right shift operator)
Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_000038a7_00000000-13_conv_layer.compute_50.cpp1.ii".
Compilation terminated.
make: *** [Makefile:578: .build_release/cuda/src/caffe/layers/conv_layer.o] Error 1?
?
==>> still have no answer yet.?
?
39. Caffe-SSD compile error:?
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/include/boost/property_tree/detail/json_parser_read.hpp: In constructor ‘boost::property_tree::json_parser::json_grammar<Ptree>::definition<Scanner>::definition(const boost::property_tree::json_parser::json_grammar<Ptree>&)’:
/usr/include/boost/property_tree/detail/json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array
escape
^
/usr/include/boost/property_tree/detail/json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array
make: *** [.build_release/cuda/src/caffe/layers/detection_output_layer.o] Error 1
?
Answer from:?https://github.com/BVLC/caffe/issues/4957?
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test $ sudo apt-get update $ sudo apt-get install gcc-5 g++-5 mona@pascal:~$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.1-2ubuntu1~14.04' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=gcc4-compatible --disable-libstdcxx-dual-abi --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 5.4.1 20160904 (Ubuntu 5.4.1-2ubuntu1~14.04)?At this moment, you already installed gcc and g++ V5 successfully. You just remove the old super-link and add the new one:?
?
cd /usr/bin sudo rm gcc sudo ln -s gcc-5 gcc sudo rm g++ sudo ln -s g++-5 g++?
40. 各種版本的 cudnn,百度云下載:
鏈接:?https://pan.baidu.com/s/1j_DzNZ2Lux95TQDjPQhoBQ?密碼: sjrc?
?
41.?
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的Caffe + CUDA8.0 + CuDNNv5.1 + OpenCV3.1 + Ubuntu14.04 配置参考文献 ---- Wang Xiao Anhui University CVP的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: fatal error: hdf5.h:
- 下一篇: Caffe 编译错误记录