1

我正在尝试运行 FCN-8s。我做了以下步骤: 1. 下载这个存储库 2. 将我的数据转换为 LMDB 并更改 train_val.prototxt 中的路径 3. 下载 fcn8s-heavy-pascal caffemodel 4. 将number_of_outputintrain_val.prototxtdeploy.prototxt60更改为5(类数在我的数据中)在最后几层:

layer {
  name: "score59"
  type: "Convolution"
  bottom: "fc7"
  top: "score59"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 5 #60
    kernel_size: 1
    engine: CAFFE
  }
}
layer {
  name: "upscore2"
  type: "Deconvolution"
  bottom: "score59"
  top: "upscore2"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  convolution_param {
    num_output: 5 #60
    bias_term: false
    kernel_size: 4
    stride: 2
  }
}
layer {
  name: "score-pool4"
  type: "Convolution"
  bottom: "pool4"
  top: "score-pool4"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 5 #60
    kernel_size: 1
    engine: CAFFE
  }
}
layer { type: 'Crop' name: 'crop' bottom: 'score-pool4' bottom: 'upscore2'
  top: 'score-pool4c' }
layer {
  name: "fuse"
  type: "Eltwise"
  bottom: "upscore2"
  bottom: "score-pool4c"
  top: "score-fused"
  eltwise_param {
    operation: SUM
  }
}
layer {
  name: "upsample-fused-16"
  type: "Deconvolution"
  bottom: "score-fused"
  top: "score4"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  convolution_param {
    num_output: 5 #60
    bias_term: false
    kernel_size: 4
    stride: 2
  }
}
layer {
  name: "score-pool3"
  type: "Convolution"
  bottom: "pool3"
  top: "score-pool3"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 5 #60
    kernel_size: 1
    engine: CAFFE
  }
}
layer { type: 'Crop' name: 'crop' bottom: 'score-pool3' bottom: 'score4'
  top: 'score-pool3c' }
layer {
  name: "fuse"
  type: "Eltwise"
  bottom: "score4"
  bottom: "score-pool3c"
  top: "score-final"
  eltwise_param {
    operation: SUM
  }
}
layer {
  name: "upsample"
  type: "Deconvolution"
  bottom: "score-final"
  top: "bigscore"
  param {
    lr_mult: 0
  }
  convolution_param {
    num_output: 5 #60
    bias_term: false
    kernel_size: 16
    stride: 8
  }
}
layer { type: 'Crop' name: 'crop' bottom: 'bigscore' bottom: 'data' top: 'score' }
layer {
  name: "loss"
  type: "SoftmaxWithLoss"
  bottom: "score"
  bottom: "label"
  top: "loss"
  loss_param {
    normalize: false
  }
}

我从帕斯卡数据集的预训练模型的权重开始训练。但随着时间的推移,损失保持不变(损失 = 105476)。

0112 18:25:07.198588  5878 sgd_solver.cpp:106] Iteration 150, lr = 1e-14
I0112 18:26:07.614239  5878 solver.cpp:228] Iteration 200, loss = 105476
I0112 18:26:07.614459  5878 solver.cpp:244]     Train net output #0: loss = 105476 (* 1 = 105476 loss)
I0112 18:26:07.614490  5878 sgd_solver.cpp:106] Iteration 200, lr = 1e-14
I0112 18:27:06.198556  5878 solver.cpp:228] Iteration 250, loss = 105476
I0112 18:27:06.198801  5878 solver.cpp:244]     Train net output #0: loss = 105476 (* 1 = 105476 loss)
I0112 18:27:06.198834  5878 sgd_solver.cpp:106] Iteration 250, lr = 1e-14
I0112 18:28:05.056469  5878 solver.cpp:228] Iteration 300, loss = 105476
I0112 18:28:05.056715  5878 solver.cpp:244]     Train net output #0: loss = 105476 (* 1 = 105476 loss)
I0112 18:28:05.056751  5878 sgd_solver.cpp:106] Iteration 300, lr = 1e-14
I0112 18:29:04.537042  5878 solver.cpp:228] Iteration 350, loss = 105476
I0112 18:29:04.537261  5878 solver.cpp:244]     Train net output #0: loss = 105476 (* 1 = 105476 loss)
I0112 18:29:04.537293  5878 sgd_solver.cpp:106] Iteration 350, lr = 1e-14
I0112 18:30:05.320504  5878 solver.cpp:228] Iteration 400, loss = 105476
I0112 18:30:05.320751  5878 solver.cpp:244]     Train net output #0: loss = 105476 (* 1 = 105476 loss)
I0112 18:30:05.320796  5878 sgd_solver.cpp:106] Iteration 400, lr = 1e-14
I0112 18:31:06.690937  5878 solver.cpp:228] Iteration 450, loss = 105476
I0112 18:31:06.691177  5878 solver.cpp:244]     Train net output #0: loss = 105476 (* 1 = 105476 loss)
I0112 18:31:06.691207  5878 sgd_solver.cpp:106] Iteration 450, lr = 1e-14
I0112 18:32:06.593940  5878 solver.cpp:228] Iteration 500, loss = 105476
I0112 18:32:06.596643  5878 solver.cpp:244]     Train net output #0: loss = 105476 (* 1 = 105476 loss)
I0112 18:32:06.596701  5878 sgd_solver.cpp:106] Iteration 500, lr = 1e-14

我不知道我做错了哪一部分。非常感谢您为解决此问题提供的帮助。

4

1 回答 1

1
  • 你是用调用的函数把surgery.transplant()solve.py网的caffemodel移植到你现在的网吗?

  • 您是否在具有初始值的反卷积层上添加weight-filler和?bias-fillernet.py

  • 做了这两个步骤后,是否执行了net.py生成更新的图层?

检查这些步骤,看看会发生什么。

于 2017-02-17T08:43:03.957 回答