【问题标题】:YOLO: How to change the frequency of mAP calculation in darknet codeYOLO:如何在暗网代码中改变mAP计算的频率
【发布时间】:2019-04-12 17:55:21
【问题描述】:

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

【问题讨论】:

    标签: yolo darknet


    【解决方案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);
    

    【讨论】:

      猜你喜欢
      • 2014-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-21
      • 1970-01-01
      相关资源
      最近更新 更多