SSD训练过程中出现问题总结

    Check failed: 0 == bottom[0]->count() % explicit_count (0 vs. 60) bottom count (209472) must be divisible by the product of the specified dimensions (84)

   这意味着test.prototxt内的mbox_conf_reshape配置有问题,具体是第三个dim的参数 dim:6,需要改成自己的待分类类别数目(要记得+background)

layer {
  name: "mbox_conf_reshape"
  type: "Reshape"
  bottom: "mbox_conf"
  top: "mbox_conf_reshape"
  reshape_param {
    shape {
      dim: 0
      dim: -1
      dim: 6
    }
  }
}

  Check failed: num_priors_ * num_classes_ == bottom[1]->channels() (52368 vs. 55168) Number of priors must match number of confidence predictions.

  这个意味着自己的网络层中输出个数不对应,具体需要修改每个conf_的num_out以及loc_层的num_out。num_out的基数是class和4(location的4个参数),2(confidence 的2个参数).按照之前的类别进行修改。

layer {
  name: "conv6_2_mbox_conf"
  type: "Convolution"
  bottom: "conv6_2"
  top: "conv6_2_mbox_conf"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 36
    pad: 1
    kernel_size: 3
    stride: 1
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0
    }
  }
}

例如 之前待分类是21类(包括背景),conv6_lconf的num_out=84,(21类×6个box),若当前分类为5,则应该修改num_out为36(6类×6个box),希望对大家有所帮助

猜你喜欢

转载自blog.csdn.net/weixin_41399111/article/details/83345942