caffe编译错误记录
1. caffe.pb.h丢失问题
错误代码如图:

zhuoshi@zhuoshi-SYS-7048GR-TR:~/ZSZT/Geoffrey/caffe/caffe-master$ make all –j8
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/layer.cpp
In file included from ./include/caffe/common.hpp:19:0,
from ./include/caffe/blob.hpp:8,
from ./include/caffe/layer.hpp:8,
from src/caffe/layer.cpp:1:
./include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: No such file or directory
compilation terminated.
Makefile:591: recipe for target '.build_release/src/caffe/layer.o' failed
make: *** [.build_release/src/caffe/layer.o] Error 1
解决方法
解决办法参考这个博客:http://blog.csdn.net/xmzwlw/article/details/48270225, 用protoc从caffe/src/caffe/proto/caffe.proto生成caffe.pb.h和caffe.pb.cc.
但是有个问题需要注意,此处不能使用'~', 而要使用完整路径

2. 未定义的引用, undefined reference to 'cblas_scopy'

参考这篇博客,https://blog.csdn.net/sdlypyzq/article/details/85237512, 的确是搞笑, 我也在open后面多了个空格,去掉就可以了.

3. Protobuf 错误
报错内容: PROTOC (python) src/caffe/proto/caffe.proto python/caffe/_caffe.cpp:1:52: fa
原因: caffe自带的requirement.txt内容如下, 只规定protobuf>=2.5.0, 并没有规定上限,所以我直接conda install protobuf导致版本过高

解决方法:
conda install protobuf=3.2
更新时间: 2019/06/10
4. libcblas.a错误

在cmake后, 修改build文件夹下的CMakeCache.txt

5. 为定义的引用libopencv_highgui.so.2.4.9

解决办法:用sudo su, 参考自链接
6. FlagRegisterer问题

解决办法:重新安装 GLog & GFlags 的安装
1)安装 GFlags
git clone https://github.com/gflags/gflags.git
cd gflags
mkdir build && cd build
cmake .. -DGFLAGS_NAMESPACE=google -DCMAKE_CXX_FLAGS=-fPIC ..
make -j4
sudo make install
2)安装 GLog:
git clone https://github.com/google/glog
cd glog
./autogen.sh
./configure CPPFLAGS="-I/usr/local/include -fPIC" LDFLAGS="-L/usr/local/lib"
make -j8
sudo make install
7. pycaffe找不到Python.h文件
添加环境变量即可
export CPLUS_INCLUDE_PATH="/opt/anaconda/envs/caffe_27/include/python2.7:$CPLUS_INCLUDE_PATH"

8. gflags命名空间问题

/home/geoffrey/caffe/include/caffe/common.hpp(31): error: "gflags" has already been declared in the current scope,
可以修改这个地方, 进行注释:
// #ifndef GFLAGS_GFLAGS_H_
namespace gflags = google;
// #endif // GFLAGS_GFLAGS_H_
具体参考: stackoverflow
9. __builtin_is_constant_evaluated未定义
报错内容:/usr/include/c++/9.1.0/bits/stl_function.h(437): error: identifier "__builtin_is_constant_evaluated" is undefined
更新时间:2019.07.17

原因, gcc版本太高,我的是系统滚动更新的gcc9.1版本, 换成gcc6好了.
对于cmake指定gcc和g++版本方法:
SET(CMAKE_C_COMPILER /usr/bin/gcc-6)
SET(CMAKE_CXX_COMPILER /usr/bin/g++-6)
10. error: token ""CUDACC_VER is no longer supported

解决办法, https://github.com/BVLC/caffe/issues/5994, upgrade boost from 1.62 to 1.65,
conda install boost=1.65
conda install boost-cpp=1.65
11. /usr/include/c++/9.2.0/bits/stl_function.h(437): 未定义"__builtin_is_constant_evaluated"
更新时间: 2019/11/07
原因: gcc版本太高,如图,cuda只支持8以下版本:
解决办法:
指定一个低版本gcc,g++:
caffe编译错误记录的更多相关文章
- C++ 编译错误记录
C++ _ZSt28__throw_bad_array_new_lengthv1 编译错误 出现场景:类似代码 vector<vector<int>> grid = {{1, ...
- VeloView源码编译错误记录——VS manifest
编译环境 Win7 Visual Studio 2008 Win32 VeloView依赖关系 1)底层 Python Qt pcap boost eigen 2)中层 liblas: boost P ...
- Maven编译错误记录:Some Enforcer rules have failed
一.错误信息 添加httpclient与httpcore依赖后编译Maven报错. 错误信息如下: Failed to execute goal org.apache.maven.plugins:ma ...
- Unity 编译错误记录
1. 相关代码: NetworkView.RPC ("ReceiveMessage", RPCMode.All, message); 编译输出: Assets/cs/ClientC ...
- cocos2dx 中文路径编译错误记录
'/Q' 不是内部或外部命令,也不是可运行的程序1> 或批处理文件.1> 'y' 不是内部或外部命令,也不是可运行的程序1> 或批处理文件.1>C:\Program Files ...
- Caffe 工程的一些编译错误以及解决方案
本系列文章由 @yhl_leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/51371936 整理一下最近遇到caff ...
- 记录一次使用VS2015编译错误的原因查找(boost+gdal)
编译错误说明 在一个解决方案中的项目A中使用到了boost,完全没有问题.在项目B中也使用了boost库,编译的时候就产生了一堆错误. 原因查找 两个项目通过对比,唯一的不同就是项目B使用了gdal库 ...
- ubuntu16.04, Matlab2016b caffe编译安装
在Ubuntu上编译安装caffe还是个比较蛋疼的事,有时候会莫名其妙的碰到很多库的问题,这篇文章就把我在Ubuntu上编译安装caffe的过程和遇到的问题大致记录一下. 1.安装opencv htt ...
- 开发错误记录8:Unable to instantiate application com
开发错误记录8:Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication 这是因为在And ...
随机推荐
- day20面向对象三大特性 , 类嵌套
#!/usr/bin/env python# -*- coding:utf-8 -*- # 1.简述面向对象三大特性并用代码表示."""封装:class Account: ...
- localhost 将您重定向的次数过多
localhost 将您重定向的次数过多 问题描述:在项目中,出现 localhost 将您重定向的次数过多 ,有可能是因为设置重定向的时候,自己重定向到自己,或者重定向成环,导致无限的重定向.检查重 ...
- Win10+Ubuntu18.04双系统安装
Win10+Ubuntu18.04 亲测UEFI启动模式双硬盘+双系统成功安装经验 https://blog.csdn.net/xrinosvip/article/details/80428133 分 ...
- 初次接触scrapy框架
初次接触这个框架,先订个小目标,抓取QQ首页,然后存入记事本. 安装框架(http://scrapy-chs.readthedocs.io/zh_CN/0.24/intro/install.html) ...
- Android AVD启动报错:emulator: ERROR: x86_64 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable.
打开Android SDK manager查看安装发现HAXM在windows上无法安装 可以去 http://www.androiddevtools.cn/index.html 下载 Android ...
- UE4代码片断备份
在Actor内创建一个StaticMesh #include "Components/StaticMeshComponent.h" #include "Engine/St ...
- 第30月第11天 Xcode 9.0中新增的API版本检查@available
1.Xcode 9.0中新增的API版本检查@available https://www.jianshu.com/p/0a94baa6c3dd https://www.jianshu.com/p/b8 ...
- Now you can provide attr "wx:key" for a "wx:for" to improve performance. 微信小程序警告
Now you can provide attr "wx:key" for a "wx:for" to improve performance为警告,不处理不影 ...
- 更改MySQL密码
#安装MySQL5.7参考:https://blog.csdn.net/qq_23033339/article/details/80872136#MYSQL的基础操作参考:https://www.cn ...
- win10下安装Cygwin配置gcc编译环境
首先要说明的是,我个人安装cygwin的用途是为了使用kenlm工具训练通及语言模型. 注:统计语言模型工具有比较多的选择,目前比较好的有srilm以及kenlm,其中kenlm比srilm晚出来,训 ...


