caffe SSD编译问题总结

来源:互联网 发布:mysql数据类型 编辑:程序博客网 时间:2024/05/22 11:32

SSD github地址:https://github.com/stoneyang/caffe_ssd


1.使用cuda8编译时出错:

/usr/include/boost/property_tree/detail/json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array

方法:因为gcc版本太低了,升级到5.3即可解决

[html] view plain copy
  1. sudo add-apt-repository ppa:ubuntu-toolchain-r/test  
  2. sudo apt-get update  
  3.   
  4. #如果提示未安装,还需要先安装它的包:  
  5. sudo apt-get install software-properties-common  
  6.   
  7. sudo apt-get install gcc-5 g++-5  
  8.   
  9. cd /usr/bin  
  10.   
  11. sudo rm gcc  
  12.   
  13. sudo ln -s gcc-5 gcc  
  14.   
  15. sudo rm g++  
  16.   
  17. sudo ln -s g++-5 g++  

重新编译即可解决


cuda8.0编译器问题

打开/usr/local/cuda/include/host_config.h

注释掉:

[python] view plain copy
  1. error -- unsupported GNU version! gcc versions later than 5.3 are not supported!  

结果如下:

[python] view plain copy
  1. #if __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 3)  
  2. //#error -- unsupported GNU version! gcc versions later than 5.3 are not supported!  
  3. #endif /* __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 1) */  



2.按照代码教程编译caffe 都通过了,运行creat_lis.py通过,但是运行creat_data.py时提示 

          AttributeError: 'module' object has no attribute 'LabelMap'

         方法:添加环境变量"export PYTHONPATH=/path/to/CaffeSSD/python:$PYTHONPATH"然后"source ~/.bashrc"

3.运行creat_data.py提示 undefine cudnn_v4

方法: 重新链接一下cudnn . 祥见欧新宇配置caffe教程 ”安装配置nVidia cuDNN 加速Caffe模型运算“部份。

4.运行 python 某个py 文件时提示:

    Traceback (most recent call last):
     File "examples/ssd/ssd_pascal.py", line 4, in <module>
      import caffe
     ImportError: No module named caffe


方法:在那个py文件加入

[html] view plain copy
  1. import sys    
  2. sys.path.append("/<span style="font-family:'trebuchet ms',arial,sans-serif;">path/to</span>/caffe-ssd/python")    
深度学习交流QQ群:116270156