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