>我正在使用 -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);
}
我假设您正在使用 Alexey 的存储库,因为-map
选项。在 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);