语义分割学习笔记(一)——SegNet 配置与训练

来源:互联网 发布:python post 文件 编辑:程序博客网 时间:2024/05/22 17:05

1 配置


1.1 资源下载与参考

 SegNet版本caffe:

        https://github.com/alexgkendall/caffe-segnet  

        https://github.com/TimoSaemann/caffe-segnet-cudnn5

参考:

      项目主页:http://mi.eng.cam.ac.uk/projects/segnet/

      指导说明:http://mi.eng.cam.ac.uk/projects/segnet/tutorial.html

环境:

     ubuntu 16.04


1.2 配置caffe

       选择的版本是TimoSaemann/caffe-segnet-cudnn5版本。

配置流程:

(1)修改Makefile.config,如果配置过caffe,可以参考已配置版本caffe的Makefile.config进行相关路径修改

(2)caffe root 文件夹下,运行 make all -j8


1.3 配置中遇到问题

(1)cuDNN版本问题:data_reader.o  Error 1 

.../usr/local/cuda-7.5//include/cudnn.h:803:27: note: declared here   cudnnStatus_t CUDNNWINAPI cudnnSetPooling2dDescriptor(                             ^  make: *** [.build_release/src/caffe/data_reader.o] Error 1 
      解决:  http://blog.csdn.net/u011070171/article/details/52292680

(2)找不到 lhdf_hl 和 lhdf5

cannot find -lhdf5 cannot find -lhdf5_hl

       解决:http://blog.csdn.net/md_learning/article/details/53185992  (该方法有效)

          https://www.douban.com/note/587917828/

(3) 运行demo: python can't import _caffe module

        解决:https://github.com/BVLC/caffe/issues/263 (caffe root 下 make pycaffe)


2 运行与训练


    (1)运行和训练可以参考 http://mi.eng.cam.ac.uk/projects/segnet/tutorial.html
    (2)segnet_basic_inference 用官网给定的caffemodel,直接运行, 结果和tutorial中的不一致,效果较差,可能caffemodel存在问题,根据说明,进行简单的训练,得到了和官网近似结果,训练配置:

net: "/SegNet/MyModels/segnet_basic_train.prototxt"  # Change this to the absolute path to your model filetest_initialization: falsetest_iter: 1test_interval: 10000000base_lr: 0.01lr_policy: "step"gamma: 1.0stepsize: 2000display: 20momentum: 0.9max_iter: 10000weight_decay: 0.0005snapshot: 1000snapshot_prefix: "/SegNet/MyModels/model/segnet_basic"  # Change this to the absolute path to where you wish to output solver snapshotssolver_mode: GPU
以下为原图、真值图、结果图:





阅读全文
1 0