【问题标题】:Tensorflow Object Detection API: Corrupted training images in TensorBoardTensorflow 对象检测 API:TensorBoard 中损坏的训练图像
【发布时间】:2021-02-17 14:39:29
【问题描述】:

我在 TensorFlow 2 中使用 TensorFlow 对象检测 API,但在 TensorBoard 中显示的训练图像存在问题,如下所示:

虽然评估图像看起来正常,但问题不在于数据序列化。

为了确保它不是通过图像增强来完成的,我只在配置文件中进行了水平翻转。查看完整的配置文件:

model {
  center_net {
    num_classes: 3
    feature_extractor {
      type: "resnet_v1_50_fpn"
    }
    image_resizer {
      keep_aspect_ratio_resizer {
        min_dimension: 512
        max_dimension: 512
        pad_to_max_dimension: true
      }
    }
    object_detection_task {
      task_loss_weight: 1.0
      offset_loss_weight: 1.0
      scale_loss_weight: 0.1
      localization_loss {
        l1_localization_loss {
        }
      }
    }
    object_center_params {
      object_center_loss_weight: 1.0
      min_box_overlap_iou: 0.7
      max_box_predictions: 100
      classification_loss {
        penalty_reduced_logistic_focal_loss {
          alpha: 2.0
          beta: 4.0
        }
      }
    }
  }
}

train_config: {

  batch_size: 5
  num_steps: 10000

  data_augmentation_options {
    random_horizontal_flip {
    }
  }
  optimizer {
    adam_optimizer: {
      epsilon: 1e-7  # Match tf.keras.optimizers.Adam's default.
      learning_rate: {
        cosine_decay_learning_rate {
          learning_rate_base: 0.3e-3
          total_steps: 10000
          warmup_learning_rate: 0.3e-3
          warmup_steps: 1000
        }
      }
    }
    use_moving_average: false
  }
  max_number_of_boxes: 100
  unpad_groundtruth_tensors: false

  fine_tune_checkpoint_version: V2
  fine_tune_checkpoint: "C:/ObjectDetection/FaceMaskDetection/Zoo/centernet_resnet50_v1_fpn_512x512_coco17_tpu-8/checkpoint/ckpt-0"
  fine_tune_checkpoint_type: "fine_tune"
}

train_input_reader: {
  label_map_path: "C:/ObjectDetection/FaceMaskDetection/Dataset/TFRecord/label_map.pbtxt"
  tf_record_input_reader {
    input_path: "C:/ObjectDetection/FaceMaskDetection/Dataset/TFRecord/train.record"
  }
}

eval_config: {
  metrics_set: "coco_detection_metrics"
  use_moving_averages: false
  batch_size: 1;
}

eval_input_reader: {
  label_map_path: "C:/ObjectDetection/FaceMaskDetection/Dataset/TFRecord/label_map.pbtxt"
  shuffle: false
  num_epochs: 1
  tf_record_input_reader {
    input_path: "C:/ObjectDetection/FaceMaskDetection/Dataset/TFRecord/eval.record"
  }
}

我正在使用centernet_resnet50_v1_fpn_512x512_coco17_tpu-8。奇怪的是损失和mAP看起来都很合理,我认为我无法用如此糟糕的训练图像获得这些数字。只是一些可视化错误吗?

【问题讨论】:

  • 我也遇到了同样的问题。我非常有信心我的 TFRecords 很好,因为我将它们与我们自己的培训工具包一起使用。此外,验证可视化不会暴露任何问题。我相信训练图像在保存到摘要之前会在某处重新归一化(乘以 255),这会导致这种情况。

标签: tensorflow computer-vision tensorflow2.0 object-detection


【解决方案1】:

我之前会遇到类似的问题,你的图像很可能没问题。这似乎是一个影响 Tensorboard 可视化的 Tensorboard/Tensorflow 标准化错误。这里有一个广泛的问题:https://github.com/tensorflow/models/issues/9115

您可以在此处阅读详细信息,总体而言,唯一的缺点是图像在 Tensorboard 中看起来很奇怪。

【讨论】:

    猜你喜欢
    • 2019-04-12
    • 2018-01-15
    • 1970-01-01
    • 2018-12-07
    • 2019-06-28
    • 2018-05-15
    • 2018-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多