【问题标题】:How to train and eval at the same time in Tensorflow Object Detection API v2如何在 Tensorflow Object Detection API v2 中同时训练和评估
【发布时间】:2021-01-02 15:31:31
【问题描述】:

我想知道如何在 Tf2 对象检测 API 的每个检查点训练和评估模型。 在文档中,他们建议先训练然后评估模型

火车

python object_detection/model_main_tf2.py \
    --pipeline_config_path=${PIPELINE_CONFIG_PATH} \
    --model_dir=${MODEL_DIR} \
    --alsologtostderr

评估

python object_detection/model_main_tf2.py \
    --pipeline_config_path=${PIPELINE_CONFIG_PATH} \
    --model_dir=${MODEL_DIR} \
    --checkpoint_dir=${CHECKPOINT_DIR} \
    --alsologtostderr

我想要的是进行培训,并在创建每个检查点(1000 步)后进行评估。 我知道在 TF-1 对象检测 API 中,评估是每 1000 步自动完成的,并且我想在 TF-2 中复制什么

【问题讨论】:

    标签: python tensorflow tensorflow2.0 object-detection object-detection-api


    【解决方案1】:

    根据 model_main_tf2.py,他们在每个 epoch 都留下了一个用于评估的标志,但它仅适用于分布式训练: https://github.com/tensorflow/models/blob/master/research/object_detection/model_main_tf2.py#L37-L38

    但是,我认为当他们通过包含评估数据添加一些标志时,他们很快就会提供它: https://github.com/tensorflow/models/blob/master/research/object_detection/model_main_tf2.py#L39-L44

    更多细节,您可以查看他们的训练功能here,这是针对他们的训练工作流程进行的描述。您可以看到他们尚未实施评估: https://github.com/tensorflow/models/blob/master/research/object_detection/model_lib_v2.py#L419

    因此,您必须通过创建一个新的 train_file 来解决问题,该文件使用 lib here 和他们创建的一些评估方法,并附加到您的训练文件以评估每个时期。或者你可以等待:D

    【讨论】:

      猜你喜欢
      • 2018-08-08
      • 2019-06-13
      • 2018-07-28
      • 2017-12-20
      • 2018-01-14
      • 2018-10-20
      • 2018-04-16
      • 1970-01-01
      • 2019-06-17
      相关资源
      最近更新 更多