• CAFFE+FASTERCNN安装记录


    本文记录了ubuntu15.10上面安装caffe和运行fasterRcnn的过程,把其中遇到的问题和解决办法记录一下,以备查看。

    主要参考

    http://ouxinyu.github.io/Blogs/20151108001.html

    Caffe + Ubuntu 15.04 + CUDA 7.5 新手安装配置指南

    http://blog.csdn.net/helloeveryon/article/details/48789079

    1:安装Ubuntu

    下载ubuntu15.10,用ultraiso做成启动盘,然后安装。安装过程中,忘了手动分配swap交换分区,系统自动分配的

    问题:ubuntu系统安装好后,文件名显示不全。

    解决:是因为显卡驱动问题,安装CUDA驱动就可以了。

    2:安装CUDA显卡驱动

    先把错配的显卡驱动清理干净

    sudo apt-get --purge remove nvidia-*

    到https://developer.nvidia.com/cuda-downloads下载对应的deb文件

    到deb的下载目录下

    sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb

    sudo apt-get update

    sudo apt-get install cuda

    sudo reboot

    完成,cuda和显卡驱动就都装好了;其他的什么都不用动

    而网上大部分中文和英文的参考教程都是过时的,折腾几个小时不说还容易装不成。

    3:安装ATLAS

    安装Intel MKL 或Atlas,没有参考博文中的方法,偷懒装的Atlas

    安装命令:

    sudo apt-get install libatlas-base-dev

    4:安装OPENCV3.1.0

    ubuntu +opencv3.1 安装指南

    http://www.tuicool.com/articles/nYJrYra

    http://my.oschina.net/drjones/blog/521664    这个教程涉及opencv2.4到3.0的升级

     问题:

    (1):file included from /usr/local/cuda/include/cuda_runtime.h:76:0, from <command-line>:0:/usr/local/cuda/include/host_config.h:115:2: error: #error -- unsupported GNU version! gcc versions later than 4.9 are not supported! #error -- unsupported GNU version! gcc versions later than 4.9 are not supported! ^

    You can try install gcc-4.9 and g++-4.9 to solve this problem temporarily. But the linker will report undefined references errors later because all other libraries (protobuf,leveldb,opencv) in Ubuntu 15.10 are compiled with GCC version 5.2. They are not compatible.

     --- #error -- unsupported GNU version! gcc versions later than 4.9 are not supported!+++ //#error -- unsupported GNU version! gcc versions later than 4.9 are not supported!

     解决:To solve this problem we have to "hack" the CUDA toolkit by editing /usr/local/cuda/include/host_config.h. Comment line 115.

    (2)在带有中文名字的文件夹中进行 make opencv3.0,导致错误,以后一定要避免有中文名字。

    (3) 修改Makefile文件(不是Makefile.config)

    在位置((LIBRARIES+= glog gflags protobuf leveldb snappy lmdbboost_system hdf5_hl hdf5 m

    opencv_coreopencv_highgui opencv_imgproc opencv_imgcodecs))处

     添加opencv_imgcodecs

     这一步非常重要,否则编译后会出现错误如下:

    原因就是opencv3.0.0把imread相关函数放到imgcodecs.lib中了,而非原来的imgproc.lib

    4:安装FASTER RCNN

    博客中内容:将你之前配置过的CaffeMakefile.config拷贝至./faster-rcnn/external/caffe,记得修改Matlab接口,接着编译就可以了。

    (1)这一步,千万不能把makefile文件也copy过去,否则后面make matcaffe 会导致找不到一些库文件路径。找不到GPU的头文件。

    (2)caffe下面生成的build文件夹是软链接不能直接copy使用。

    (3)直接copy的其他人的模型,导致出现下面错误,还是老实点从作者Baidu云盘下吧。

    MATLAB被杀死,内存如果不足,会提示out of memory。

  • 相关阅读:
    如何用密码保护共享文件?
    如何让光驱自动弹出和关闭?
    欢迎参加“诊断 Windows 7 启动及登录缓慢问题”在线技术会议
    谁偷走了我的系统资源?
    修改Windows验证的登陆框为页面
    使用Fiddler提高前端工作效率
    对非管理员隐藏Site Actions的菜单
    C#多线程参数传递
    转:管理网站集所使用的内容数据库
    转:十步骤让你轻松提升SharePoint性能
  • 原文地址:https://www.cnblogs.com/linkboy1980/p/5469994.html
Copyright © 2020-2023  润新知