SSD訓練過程中出現問題總結
阿新 • • 發佈:2018-12-17
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),希望對大家有所幫助