1

我正在使用 -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);
}
4

1 回答 1

2

-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);
于 2019-04-15T00:28:42.617 回答