如何修改批处理规范化层(DeconvNet)以使其能够与caffe一起运行? [英] How to modify batch normalization layers (DeconvNet) to be able to run with caffe?

查看:218
本文介绍了如何修改批处理规范化层(DeconvNet)以使其能够与caffe一起运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想运行 Deconvnet 我的数据,但是似乎它是为 caffe 的另一个版本编写的。有人知道如何更改 batch_params 吗?

I wanted to run the Deconvnet on my data, however it seemd it has been written for another version of caffe. Does anyone know how to change batch_params?

在Deconvnet中的那个

The one that is in Deconvnet

layers { bottom: 'conv1_1' top: 'conv1_1' name: 'bn1_1' type: BN
  bn_param { scale_filler { type: 'constant' value: 1 }
             shift_filler { type: 'constant' value: 0.001 }
             bn_mode: INFERENCE } }

和Caffe为 cifar10 提供的示例:

And the one that Caffe provides for cifar10 example:

layer {
  name: "bn1"
  type: "BatchNorm"
  bottom: "pool1"
  top: "bn1"
  batch_norm_param {
    use_global_stats: true
  }
  param {
    lr_mult: 0
  }
  param {
    lr_mult: 0
  }
  param {
    lr_mult: 0
  }
  include {
    phase: TEST
  }
}

一旦我想运行它,请先向我显示以下错误:

Once I wanted to run it show me the following error first:

I1029 13:46:47.156885 11601 solver.cpp:87] Creating training net from net file: train_val.prototxt
[libprotobuf ERROR google/protobuf/text_format.cc:299] Error parsing text-format caffe.NetParameter: 59:3: Unknown enumeration value of "BN" for field "type".
F1029 13:46:47.157971 11601 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param)

,将 BN 更改为 BatchNorm 后,它显示有关参数的新错误:

and after changing BN into BatchNorm, it shows new error about parameters:

I1029 14:03:38.497725 12097 solver.cpp:87] Creating training net from net file: train_val.prototxt
[libprotobuf ERROR google/protobuf/text_format.cc:299] Error parsing text-format caffe.NetParameter: 59:3: Unknown enumeration value of "BatchNorm" for field "type".
F1029 14:03:38.503345 12097 upgrade_proto.cpp:88] Check failed: ReadProtoFromTextFile(param_file, param)

有人尝试过训练Deconvnet吗?如果可以,请您指导我吗?
谢谢

Has anyone tried to train Deconvnet? if yes could you please guide me? Thanks

推荐答案

能否让我知道这种更改是否正确?

Could you please let me know if this is correct to change like this?

layer {
  name: "bn1_1"
  type: "BatchNorm"
  bottom: "conv1_1"
  top: "conv1_1"
  param {
    lr_mult: 0
  }
  param {
    lr_mult: 0
  }
  param {
    lr_mult: 0
  }
  include {
    phase: TEST
  }
  batch_norm_param {
    use_global_stats: true
  }
}
layer {
  name: "scale_conv1_1"
  type: "Scale"
  bottom: "conv1_1"
  top: "conv1_1"
  scale_param {
    bias_term: true
    bias_filler {
      type: "constant"
      value: 0.001
    }
  }
}

这篇关于如何修改批处理规范化层(DeconvNet)以使其能够与caffe一起运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆