Ubuntu14.04安装配置深度网络SSD

安装Ubuntu14.04

本文安装的是双系统

安装Caffe依赖

基本依赖
参考http://caffe.berkeleyvision.org/install_apt.html

安装CUDA

  1. 在https://developer.nvidia.com/cuda-downloads选择合适的版本下载安装
  2. 执行以下命令
sudo dpkg -i cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda

可能遇到的问题

  1. 如果CUDA装完以后提示电脑开启了secure boot导致不能兼容一些第三方应用,可以进入BIOS关闭secure boot(可能需要清除key)
  2. 如果在Ubuntu的登陆页面输入密码后不能进入系统,还是回到登陆页面,参考以下网址:https://www.zhihu.com/question/40729403
  3. 如果安装过程中遇到问题需要重装,可以直接删除/usr/local/中的cuda文件夹,然后命令行运行apt-get autoremove自动删除相关包
  4. 安装过程可以参考https://blog.csdn.net/u010837794/article/details/63251725/ 要先安装显卡驱动

编译SSD

基本过程
参考官方github:https://github.com/weiliu89/caffe/tree/ssd

可能出现的问题

  1. 执行make的时候碰到下面的问题:
/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 

解决方案:http://blog.csdn.net/allyli0022/article/details/62881238

2.执行make py的时候碰到下面的问题:

python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: 没有那个文件或目录
 #include <numpy/arrayobject.h>
                               ^
compilation terminated.
make: *** [python/caffe/_caffe.so] 错误 1

这是因为没有安装numpy,执行sudo apt-get install python-numpy

#准备数据
1.执行./data/VOC0712/create_list.sh时显示找不到Annotations和JPEGImages里的文件,如下:

E0412 16:28:31.653440 5008 io.cpp:187] Could not open or find file/home/guyadong/data/VOCdevkit/facedata/JPEGImages/070010 

这可能是因为windows和linux系统换行符不同所致,详情参考:http://blog.csdn.net/10km/article/details/70144925

2.执行./data/VOC0712/create_data.sh时报下述错误:

ImportError: No module named caffe.proto

这是因为没有添加python路径,解决方案:http://blog.csdn.net/lanyuelvyun/article/details/73628152

3.执行./data/VOC0712/create_data.sh时报下述错误:

ImportError: No module named _caffe

需要编译pycaffe,执行:

make pycaffe

4.执行./data/VOC0712/create_data.sh时报下述错误:

ImportError: No module named skimage.io

是因为没有安装模块,执行:

pip install scikit-image

4.1安装scikit-image的时候报以下错误:

error: library dfftpack has Fortran sources but no Fortran compiler found

需要安装模块:

sudo apt-get install gfortran

5.提示无法importcaffe_caffe,执行:

export PYTHONPATH=$PYTHONPATH:/home/{YOUR_NAME}/caffe/python

#训练数据
要修改以下几个文档中的代码:
1.修改$CAFFE_ROOT/caffe/example/ssd_pascal.py

# Solver parameters.
# Defining which GPUs to use.
gpus = "0,1,2,3" ==> 改成"0"//如果是1个GPU
gpulist = gpus.split(",")
num_gpus = len(gpulist)

2.修改$CAFFE_ROOT/caffe/example/ssd_pascal.py

# Divide the mini-batch to different GPUs.
batch_size = 32 ==> 如果运行中出现memory不够的错误,适当改小
accum_batch_size = 32
iter_size = accum_batch_size / batch_size

3.修改$CAFFE_ROOT/caffe/Makefile.config:

# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the lines after *_35 for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
             -gencode arch=compute_20,code=sm_21 \
             -gencode arch=compute_30,code=sm_30 \
             -gencode arch=compute_35,code=sm_35 \
             -gencode arch=compute_50,code=sm_50 \
             -gencode arch=compute_52,code=sm_52 
             -gencode arch=compute_61,code=sm_61 \
# 根据CUDA计算能力修改

CUDA计算能力参考:blog.csdn.net/real_myth/article/details/44308169

训练自己的数据(直接修改原来数据集文件夹)
直接修改data/VOCdevkit/VOC2007中的文件(VOC2012不用,可以直接删除或更名)

  1. 清除AnnotationsJPEGImages文件夹内的内容,保留AnnotationsJPEGImagesImageSets,删除其它文件夹。
  2. 清除ImageSets文件夹里的LayoutMainSegmentation里的内容,保留这3个文件夹,删除其它文件夹。
  3. 将自己的标记文件放在Annotations,图片放在JPEGImages
  4. /home/ellen/data/VOCdevkit/VOC2007/ImageSets/Main中创建test.txttrainal.txt两个文件。
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值