如何微调自定义数据集的预训练对象检测模型?

时间:2021-01-18 22:19:07

标签: python tensorflow deep-learning object-detection

我是深度学习的新手,我正在从事一些研究生工作,以训练对象检测算法来检测田地中的杂草。我将使用的模型在 TensorFlow 2 Detection Model Zoo 上找到,并计划使用算法,例如(但不限于)Faster R-CNN 和 EfficientDet。为此,我正在使用 TensorFlow 2.3.0 和 python 3.8。我发现了一个 very helpful tutorial 展示了如何训练自定义数据集,所以我正在关注它。我不明白的是我将如何微调模型,以便为我的自定义数据集更新我的权重。我的工作流程如下:

  1. 使用 LabelImg 使用 Pascal VOC 边界框标记图像。
  2. 创建标签映射,指定我的图像数据库中表示的类(在我的例子中为 1)。
  3. 为训练和测试数据集创建 TensorFlow Record 文件
  4. 从 Model Zoo 下载预训练模型。
  5. 将 pipeline.config 模型中的参数更改为
  6. 开始训练模型

如果你碰巧看到 .config 文件,有一个部分指定了大多数算法上微调检查点的位置,如下所示:

fine_tune_checkpoint: "pre-trained-models/ssd_resnet50_v1_fpn_640x640_coco17_tpu-8/checkpoint/ckpt-0" # Path to checkpoint of pre-trained model
  num_steps: 25000
  startup_delay_steps: 0.0
  replicas_to_aggregate: 8
  max_number_of_boxes: 100
  unpad_groundtruth_tensors: false
  fine_tune_checkpoint_type: "detection" # Set this to "detection" since we want to be training the full detection model
  use_bfloat16: false # Set this to false if you are not training on a TPU
  fine_tune_checkpoint_version: V2

这是在自定义数据上微调 TensorFlow 对象检测 API 算法的正确程序吗?我找不到任何关于如何微调这些算法的明确教程,所以如果有人有任何用于此目的的教程,请告诉我。

0 个答案:

没有答案