无法加载libcaffe库-android-lib库(已经编译过)如何在Android设备上进行分类(已有window下训练得到模型)

I struggle with
compilation. Unfortunately I failed to compile it.
I followed:
git clone https://github.com/BVLC/caffe.git
mkdir build
Running make all fails with the following error message:
2%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile.dir/util/cuda_compile_generated_im2col.cu.o
In file included from /usr/include/cuda_runtime.h:59:0,
from &command-line&:0:
/usr/include/host_config.h:82:2: error: #error -- unsupported GNU version! gcc 4.9 and up are not supported!
#error -- unsupported GNU version! gcc 4.9 and up are not supported!
CMake Error at cuda_compile_generated_im2col.cu.o.cmake:207 (message):
Error generating /mydir/caffe/build/src/caffe/CMakeFiles/cuda_compile.dir/util/./cuda_compile_generated_im2col.cu.o
Software version:
OS: Debian.
gcc version: 5.3.1.
nvcc version: 6.5.12.
cat /proc/driver/nvidia/version result:
NVRM version: NVIDIA UNIX x86_64 Kernel Module
7 21:25:42 PST 2015
GCC version:
gcc version 4.8.5 (Debian 4.8.5-3)
Attempts to solve the problem
Simple solutions are often best ones, so (as suggested ) I tried to comment out macro checking gcc version from /usr/include/host_config.h (line 82). Unfortunately it doesn't work and compilation fails badly:
1 catastrophic error detected in the compilation of "/tmp/tmpxft___im2col.cpp4.ii".
I tried to run:
cmake -D CMAKE_CXX_COMPILER=g++-4.8 ..
but it fails with exactly the same error message (even though g++-4.8 should be accepted).
I've found
(though not related to Caffe) and I tried to solve it as suggested in the accepted answer.
What I did:
I've ran grep -iR "find_package(CUDA" caffe command and found
file which has find_package(CUDA 5.5 QUIET) in line .
I added set(CUDA_HOST_COMPILER /usr/bin/gcc-4.8) to , line before line: find_package(CUDA 5.5 QUIET).
I removed everything from build directory and ran cmake and make again - with and without -D CMAKE_CXX_COMPILER=g++-4.8.
Unfortunately result is exactly the same. Caffe probably overwrites it somehow - I didn't figure it out how.
make VERBOSE=1 2&&1 | grep -i compiler-bindir returns nothing.
What's interesting, make VERBOSE=1 prints command that fails, which is:
/usr/bin/nvcc -M -D__CUDACC__ /mydir/caffe/src/caffe/util/im2col.cu -o /mydir/caffe/build/src/caffe/CMakeFiles/cuda_compile.dir/util/cuda_compile_generated_im2col.cu.o.NVCC-depend -ccbin /usr/bin/cc -m64 -DUSE_LMDB -DUSE_LEVELDB -DUSE_OPENCV -DWITH_PYTHON_LAYER -DGTEST_USE_OWN_TR1_TUPLE -Xcompiler ,\"-fPIC\",\"-Wall\",\"-Wno-sign-compare\",\"-Wno-uninitialized\",\"-O3\",\"-DNDEBUG\" -gencode arch=compute_20,code=sm_21 -Xcudafe --diag_suppress=cc_clobber_ignored -Xcudafe --diag_suppress=integer_sign_change -Xcudafe --diag_suppress=useless_using_declaration -Xcudafe --diag_suppress=set_but_not_used -Xcompiler -fPIC -DNVCC -I/usr/include -I/mydir/caffe/src -I/usr/include -I/mydir/caffe/build/include -I/usr/include/hdf5/serial -I/usr/include/opencv -I/usr/include/atlas -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/mydir/caffe/include -I/mydir/caffe/build
when I add --compiler-bindir /usr/bin/gcc-4.8 flag manually, it prints error:
nvcc fatal
: redefinition of argument 'compiler-bindir'
which may be related to
bug report.
Edit: I didn't notice that --compiler-bindir and -ccbin are the same options, and the latter is already set in above command that failed. When I changed -ccbin /usr/bin/cc to -ccbin /usr/bin/gcc-4.8 in above command that failed, it completes successfully. Now I need to find option in Caffe's CMake file that overwrite -ccbin in all subsequent Caffe's CMakes. Looking at cmake/Cuda.cmake:252:list(APPEND CUDA_NVCC_FLAGS ${NVCC_FLAGS_EXTRA} seems to be good way to go.
How can I successfully complete my compilation? Any help is appreciated.
Related SO questions:
解决方案 cmake -D CUDA_NVCC_FLAGS="-ccbin gcc-4.8" .. && make causes successful compilation.
Now another problem showed up: linking Google's libgflags or libprotobuf fails probably due to fact that it was compiled with newer gcc version but it's not related to asked question.
本文地址: &
我遇到了汇编。很遗憾,我无法编译它。
git clone https://github.com/ BVLC / caffe.git
mkdir build
运行使所有失败,并显示以下错误消息:
[2%]构建NVCC(设备)对象src / caffe / CMakeFiles / cuda_compile.dir / util / cuda_compile_generated_im2col.cu.o 在/usr/include/cuda_runtime.h:59:0中包含的文件中,来自& command-line&:0: /usr/include/host_config.h:82:2:error: #error
- 不受支持的GNU版本! gcc 4.9及以上不支持!
- 不受支持的GNU版本! gcc 4.9及以上不支持!
CMake在cuda_compile_generated_im2col.cu.o.cmake错误:207(消息):生成/mydir/caffe/build/src/caffe/CMakeFiles/cuda_compile.dir/util/时出错./cuda_compile_generated_im2col.cu.o
软件版本:
操作系统: Debian 。
version: 5.3.1 。
code> 6.5.12 。
cat / proc / driver / nvidia / version
NVRM版本:NVIDIA UNIX x86_64内核模块352.63六Nov 7 21:25:42 PST 2015
GCC版本:gcc版本4.8.5(Debian 4.8.5-3)
尝试解决问题
第一次尝试 h3>
简单的解决方案通常是最好的解决方案,因此(建议
我找到了(虽然与 Caffe 不相关),我试图按照接受的答案中的建议解决它。
我做了什么:
我跑了 grep -iR“find_package CUDA“caffe 命令,并找到在。 $
set(CUDA_HOST_COMPILER /usr/bin/gcc-4.8)到,行前: find_package(CUDA 5.5 QUIET) li>
我从 build 目录中删除了所有内容,并运行了 cmake 和 make 再次 - 包含和不包含 -D CMAKE_CXX_COMPILER = g ++
不幸的是,结果是完全一样的。
make VERBOSE = 1 2&& ; 1 | grep -i compiler-bindir 不返回任何内容。
有趣的是, make VERBOSE = 1
prints命令失败,这是:
/ usr / bin / nvcc -M -D__CUDACC__ /mydir/caffe/src/caffe/util/im2col.cu -o /mydir/caffe/build/src/caffe/CMakeFiles/cuda_compile.dir/util/cuda_compile_generated_im2col.cu.o.NVCC-depend -ccbin / usr / bin / cc -m64 -DUSE_LMDB -DUSE_LEVELDB -DUSE_OPENCV -DWITH_PYTHON_LAYER -DGTEST_USE_OWN_TR1_TUPLE -Xcompiler,\“-fPIC\”,\“-Wall \”,\“-Wno-sign-compare \”,\ “-Wno-uninitialized \”,\“-O3 \”,\“-DNDEBUG\”-gencode arch = compute_20,code = sm_21 -Xcudafe --diag_suppress = cc_clobber_ignored -Xcudafe --diag_suppress = integer_sign_change
- Xcudafe --diag_suppress = useless_using_declaration -Xcudafe --diag_suppress = set_but_not_used -Xcompiler -fPIC -DNVCC -I / usr / include -I / mydir / caffe / src -I / usr / include -I / mydir / caffe / build / include
- I / usr / include / hdf5 / serial -I / usr / include / opencv -I / usr / include / atlas -I / usr / include / python2.7 -I / usr / lib / python2.7 / numpy / core / include -I / mydir / caffe / include -I / mydir / caffe / build
当我手动添加
compiler-bindir /usr/bin/gcc-4.8 标志时,它输出错误:
nvcc fatal:redefinition of argument'compiler-bindir'
这可能与错误报告相关。
编辑:我没有注意到
compiler-bindir 和 -ccbin 是相同的选项,后者已经在上面的命令中设置失败。当我在上面将 -ccbin / usr / bin / cc 更改为 -ccbin /usr/bin/gcc-4.8 命令失败,它成功完成。现在我需要找到选项在Caffe的CMake文件中覆盖 -ccbin 在所有后续的Caffe的CMakes。看看 cmake / Cuda.cmake:252:list(APPEND CUDA_NVCC_FLAGS $ {NVCC_FLAGS_EXTRA} 似乎是一个很好的方式。
我如何成功完成我的编译?任何帮助。
相关问题:
扫一扫关注官方微信今日: 2|昨日: 9|帖子: 104518|会员: 78077|欢迎新会员:
参数错误怎么解决?
使用kinect
opencv 轨迹线显示 ...
二值化处理完图片后怎么把想要的 ...
请教关于输送带上物品的跟踪检测 ...
Android里Bitmap转Mat(如何自己 ...
双目视觉测距,reprojectImageTo ...
有没有在做双目的同学
计算得到了亚像素坐标后,怎么输 ...
opencv测试程序不能显示图片 ...
用compareHist()函数对比直方图 ...
Android里Bitmap转Mat(如何自己 ...
有偿求助:camshift + kalman 实 ...
求教----亚像素边缘检测精度如何 ...
《OpenCV入门教程》
删除轮廓树中面积较小的轮廓的操 ...
计算得到了亚像素坐标后,怎么输 ...
大佬求助 迅为4412+linux +QT +o ...
双目视觉测距,reprojectImageTo ...
有没有在做双目的同学
Android里Bitmap转Mat(如何自己 ...
有偿求助:camshift + kalman 实 ...
求教----亚像素边缘检测精度如何 ...
《OpenCV入门教程》
计算得到了亚像素坐标后,怎么输 ...
在安卓下使用opencv3.2的问题 ...
怎么用opencv将二维数组转为图像 ...
没有软件基础的可以学么 ...
双目三维重建软件开源
OpenCV使用问题:如函数调用,编译出错等版主:
昨天&23:12
相关的算法以及理论:图像处理、计算机视觉、机器学习等版主: ,
5484 / 2万
昨天&23:01
ARM平台下的OpenCV使用,Android,iOS,TI DSP
846 / 3063
前天&15:23
中文文档的改善,需要您的加入!
在C#中使用OpenCV
508 / 1865
除了政治、色情和暴力的话题,随便聊聊
498 / 2256
前天&21:05
与OpenCV,图像处理,计算机视觉,模式识别有关的招聘和求职信息
981 / 3288
昨天&16:00
建议、意见和问题,举报广告及敏感帖子
Powered by没有更多推荐了,
不良信息举报
举报内容:
小白的进阶之路—Caffe移动端的编译及jni开发
举报原因:
原文地址:
原因补充:
最多只允许输入30个字
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!win10系统怎么连接Android设备_百度知道
win10系统怎么连接Android设备
我有更好的答案
  工具:  window10  手机助手  方法:打开手机助手,点击android点击隐藏,选择将图片和视频导入到照片应用中从图片中可以看到开始寻找了,说明已经连接上了
【手机助手】打开界面如下android设备点击这个地方进入android同步界面如下点击这个“显示、隐藏”设备的属性(电量,存储卡信息)点击【将照片和视频导入到】电脑会自动扫描照片等数据(有时候会很慢)
本回答被提问者采纳
方法/步骤方法一:通过“Windows 10 Mobile APK Installer”程序来部署安装APK应用。直接在百度中搜索下载此应用 首先,我们需要在Win10手机中开启“开发人员模式”,同时将“设备发现”开启,以允许其它设备检测Win10手机。接下来解压并双击运行其中的“Windows 10 Mobile APK Installer”程序,在安装过程中,选择安装目录中确保安装目录文件夹不留空格。如图所示:在安装“Windows 10 Mobile APK Installer”程序过程中,还需要安装“Microsoft Visual C++运行库”的支持。接下来将Win10 Moblie手机与电脑通过USB数据线进行连接,运行“Windows 10 Mobile APK Installer”程序,使用Win10手机中的“配对代码”与电脑程序进行匹配操作。将“连接方式”设置“USB连接”,同时点击“连接手机”按钮,待连接手机成功后,选择要安装的APK程序,点击“立即安装”按钮。此时就可以将APK应用安装到Win10 Moblie手机中啦。
为您推荐:
其他类似问题
您可能关注的内容
勃兰兑斯的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。

我要回帖

更多关于 caffe android lib 的文章

 

随机推荐