深度学习Caffe框架中,Solver文件和Net文件分别是什么,怎么编写?-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

深度学习Caffe框架中,Solver文件和Net文件分别是什么,怎么编写?

ali小鱼 2017-06-28 16:25:08 2327

在PAI平台深度学习Caffe框架实现图像分类的模型训练中,Caffe配置文件需要编写Solver文件和Net文件,不知道怎么写法

深度学习net 深度学习框架 caffe深度学习 深度学习文件 深度学习是什么
分享到
取消 提交回答
全部回答(2)
  • zhaifly
    2019-07-17 21:20:33
    已采纳

    net 网络模型:
    name: "LeNet"
    layer {
    name: "data"
    type: "Input"
    top: "data"
    input_param { shape: { dim: 64 dim: 1 dim: 28 dim: 28 } }
    }
    layer {
    name: "conv1"
    type: "Convolution"
    bottom: "data"
    top: "conv1"
    param {

    lr_mult: 1

    }
    param {

    lr_mult: 2

    }
    convolution_param {

    num_output: 20
    kernel_size: 5
    stride: 1
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
    }

    }
    }
    layer {
    name: "pool1"
    type: "Pooling"
    bottom: "conv1"
    top: "pool1"
    pooling_param {

    pool: MAX
    kernel_size: 2
    stride: 2

    }
    }
    layer {
    name: "conv2"
    type: "Convolution"
    bottom: "pool1"
    top: "conv2"
    param {

    lr_mult: 1

    }
    param {

    lr_mult: 2

    }
    convolution_param {

    num_output: 50
    kernel_size: 5
    stride: 1
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
    }

    }
    }
    layer {
    name: "pool2"
    type: "Pooling"
    bottom: "conv2"
    top: "pool2"
    pooling_param {

    pool: MAX
    kernel_size: 2
    stride: 2

    }
    }
    layer {
    name: "ip1"
    type: "InnerProduct"
    bottom: "pool2"
    top: "ip1"
    param {

    lr_mult: 1

    }
    param {

    lr_mult: 2

    }
    inner_product_param {

    num_output: 500
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
    }

    }
    }
    layer {
    name: "relu1"
    type: "ReLU"
    bottom: "ip1"
    top: "ip1"
    }
    layer {
    name: "ip2"
    type: "InnerProduct"
    bottom: "ip1"
    top: "ip2"
    param {

    lr_mult: 1

    }
    param {

    lr_mult: 2

    }
    inner_product_param {

    num_output: 10
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
    }

    }
    }
    layer {
    name: "prob"
    type: "Softmax"
    bottom: "ip2"
    top: "prob"
    }

    solver:

    The train/test net protocol buffer definition

    net: "examples/mnist/lenet_train_test.prototxt"

    test_iter specifies how many forward passes the test should carry out.

    In the case of MNIST, we have test batch size 100 and 100 test iterations,

    covering the full 10,000 testing images.

    test_iter: 100

    Carry out testing every 500 training iterations.

    test_interval: 500

    The base learning rate, momentum and the weight decay of the network.

    base_lr: 0.01
    momentum: 0.9
    weight_decay: 0.0005

    The learning rate policy

    lr_policy: "inv"
    gamma: 0.0001
    power: 0.75

    Display every 100 iterations

    display: 100

    The maximum number of iterations

    max_iter: 10000

    snapshot intermediate results

    snapshot: 5000
    snapshot_prefix: "examples/mnist/lenet"

    solver mode: CPU or GPU

    solver_mode: CPU

    1 0
  • michaelxing
    2019-07-17 21:20:33

    现在没法配置 --weights参数吧?

    0 0
添加回答
人工智能
使用钉钉扫一扫加入圈子
+ 订阅

了解行业+人工智能最先进的技术和实践,参与行业+人工智能实践项目

相似问题
最新问题
推荐课程