YOLO:如何更改暗网代码中的mAP计算频率

时间:2019-04-12 17:55:21

标签: yolo darknet

我正在训练带有-map选项的YOLOv2以打印平均精度。我需要更改地图的计算频率。目前,每300次迭代就会计算一次,这对我来说太频繁了。我希望每进行一次计算(例如2000次迭代)。有没有办法更改交换机的密码?

我确实在detector.c文件中看到以下代码,需要更改。有输入吗?

int calc_map_for_each = 4 * train_images_num / (net.batch * net.subdivisions);  // calculate mAP for each 4 Epochs
calc_map_for_each = fmax(calc_map_for_each, 100);
int next_map_calc = iter_map + calc_map_for_each;
next_map_calc = fmax(next_map_calc, net.burn_in);
next_map_calc = fmax(next_map_calc, 1000);
if (calc_map) {
    printf("\n (next mAP calculation at %d iterations) ", next_map_calc);
    if (mean_average_precision > 0) printf("\n Last accuracy mAP@0.5 = %2.2f %% ", mean_average_precision * 100);
}

1 个答案:

答案 0 :(得分:1)

由于-map选项,我假设您正在使用Alexey的仓库。在detector.c(https://github.com/AlexeyAB/darknet/blob/8c970498a296ed129ffef7d872ccc25d42d1afda/src/detector.c#L223)中,您可以更改以下代码:

calc_map_for_each = fmax(calc_map_for_each, 100);

calc_map_for_each = fmax(calc_map_for_each, 1000);