SegNet

一.Caffe原版

  1. 论文,官方教程(文件组织方式、训练、测试),官方资源库,训练好的模型
  2. 下载SegNet-Tutorial,命名为SegNet。包含训练数据和列表。
  3. 下载caffe-segnet,如果出现cudnn错误可以下载caffe-segnet-cudnn5。命名为caffe-segnet,放入上面的SegNet。
  4. 为了编译Caffe,安装OpenCV是要选中BUILD_TIFF=ON,或使用cmake .. -DBUILD_TIFF=ON。
  5. 编译Caffe:进入caffe-segnet,创建build文件夹编译,或按照教程
  6. 按照官方教程训练测试。

二.Tensorflow复现版

  1. 下载源码
  2. 可以把Caffe版的数据集拿来用。
  3. 错误及解决
    #错误
    ".../tensorflow/python/ops/gradients_impl.py", line 459, in gradients
        (op.name, op.type))
    LookupError: No gradient defined for operation 'pool4' (op type: MaxPoolWithArgmax)
    #解决
    from tensorflow.python.framework import ops
    from tensorflow.python.ops import gen_nn_ops
    @ops.RegisterGradient("MaxPoolWithArgmax")
    def _MaxPoolWithArgmaxGrad(op, grad, unused_argmax_grad):
      return gen_nn_ops._max_pool_grad(op.inputs[0],
                                       op.outputs[0],
                                       grad,
                                       op.get_attr("ksize"),
                                       op.get_attr("strides"),
                                       padding=op.get_attr("padding"),
                                       data_format='NHWC')
    
    #错误
    InvalidArgumentError (see above for traceback): No OpKernel was registered to support Op 'MaxPoolWithArgmax' with these attrs.  Registered devices: [CPU], Registered kernels:
      device='GPU'; Targmax in [DT_INT64]; T in [DT_HALF]
      device='GPU'; Targmax in [DT_INT64]; T in [DT_FLOAT]
    
    	 [[Node: pool1 = MaxPoolWithArgmax[T=DT_FLOAT, Targmax=DT_INT64, ksize=[1, 2, 2, 1], padding="SAME", strides=[1, 2, 2, 1]](conv1/Relu)]]
    #原因:缺少GPU

     

  4. 第四
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值