Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
tensorflow目标检测:RFCN模块';sMAP@0.5价格很低_Tensorflow_Object Detection Api - Fatal编程技术网

tensorflow目标检测:RFCN模块';sMAP@0.5价格很低

tensorflow目标检测:RFCN模块';sMAP@0.5价格很低,tensorflow,object-detection-api,Tensorflow,Object Detection Api,我使用tensorflow对象检测api()来训练rfcn模型,使用voc 2007+2012 trainval数据集,并在voc 2007测试中进行测试。这个MAP@0.5与caffe版本相比要低得多。caffe版本训练110000次迭代,tensorflow版本训练140000次迭代。预训练的resnet-v1-50模块,用于初始化主干功能提取器。配置文件如下所示: #pascal_voc_resnet50_rfcn.config: model { faster_rcnn { n

我使用tensorflow对象检测api()来训练rfcn模型,使用voc 2007+2012 trainval数据集,并在voc 2007测试中进行测试。这个MAP@0.5与caffe版本相比要低得多。caffe版本训练110000次迭代,tensorflow版本训练140000次迭代。预训练的resnet-v1-50模块,用于初始化主干功能提取器。配置文件如下所示:

#pascal_voc_resnet50_rfcn.config:
model {
  faster_rcnn {
    num_classes: 20
    image_resizer {
      keep_aspect_ratio_resizer {
        min_dimension: 600
        max_dimension: 1024
      }
    }
    feature_extractor {
      type: 'faster_rcnn_resnet50'
      first_stage_features_stride: 16
    }
    first_stage_anchor_generator {
      grid_anchor_generator {
        scales: [0.5, 1.0, 2.0]
        aspect_ratios: [0.5, 1.0, 2.0]
        height_stride: 16
        width_stride: 16
      }
    }
    first_stage_box_predictor_conv_hyperparams {
      op: CONV
      regularizer {
        l2_regularizer {
          weight: 0.0005
        }
      }
      initializer {
        truncated_normal_initializer {
          stddev: 0.01
        }
      }
    }
    first_stage_nms_score_threshold: 0.0
    first_stage_nms_iou_threshold: 0.7
    first_stage_max_proposals: 300
    first_stage_localization_loss_weight: 1.0
    first_stage_objectness_loss_weight: 1.0
    second_stage_box_predictor {
      rfcn_box_predictor {
        conv_hyperparams {
          op: CONV
          regularizer {
            l2_regularizer {
              weight: 0.0005
            }
          }
          initializer {
            truncated_normal_initializer {
              stddev: 0.01
            }
          }
        }
        crop_height: 18
        crop_width: 18
        num_spatial_bins_height: 3
        num_spatial_bins_width: 3
      }
    }
    second_stage_post_processing {
      batch_non_max_suppression {
        score_threshold: 0.0
        iou_threshold: 0.7
        max_detections_per_class: 100
        max_total_detections: 300
      }
      score_converter: SOFTMAX
    }
    second_stage_localization_loss_weight: 1.0
    second_stage_classification_loss_weight: 1.0
  }
}

train_config: {
  batch_size: 1
  optimizer {
    momentum_optimizer: {
      learning_rate: {
        manual_step_learning_rate {
          initial_learning_rate: 0.001
          schedule {
            step: 0
            learning_rate: .001
          }
          schedule {
            step: 900000
            learning_rate: .0001
          }
          schedule {
            step: 1200000
            learning_rate: .00001
          }
        }
      }
      momentum_optimizer_value: 0.9
    }
    use_moving_average: false
  }
  gradient_clipping_by_norm: 10.0
  fine_tune_checkpoint: "resnet_v1_50/resnet_v1_50.ckpt"
  from_detection_checkpoint: false
  # Note: The below line limits the training process to 200K steps, which we
  # empirically found to be sufficient enough to train the pets dataset. This
  # effectively bypasses the learning rate schedule (the learning rate will
  # never decay). Remove the below line to train indefinitely.
  num_steps: 1500000
  data_augmentation_options {
    random_horizontal_flip {
    }
  }
}

train_input_reader: {
  tf_record_input_reader {
    input_path: "voc_dataset/trainval.tfrecords"
  }
  label_map_path: "object_detection/data/pascal_label_map.pbtxt"
}

eval_config: {
#  num_examples: 8000
  num_examples: 4952
  num_visualizations: 4952
  # Note: The below line limits the evaluation process to 10 evaluations.
  # Remove the below line to evaluate indefinitely.
  max_evals: 1
  visualization_export_dir: 'outputs_eval_imgs'
  metrics_set: 'pascal_voc_metrics'
}

eval_input_reader: {
  tf_record_input_reader {
    input_path: "voc_dataset/test.tfrecords"
  }
  label_map_path: "object_detection/data/pascal_label_map.pbtxt"
  shuffle: false
  num_readers: 1
  num_epochs: 1
}
最终结果是: PASCALBOX_性能分类/AP@0.5IOU/飞机:0.701776 PASCALBOX_性能分类/AP@0.5IOU/自行车:0.742742 PASCALBOX_性能分类/AP@0.5IOU/鸟:0.723409 PASCALBOX_性能分类/AP@0.5IOU/船只:0.513328 PASCALBOX_性能分类/AP@0.5IOU/瓶子:0.531051 PASCALBOX_性能分类/AP@0.5IOU/巴士:0.769170 PASCALBOX_性能分类/AP@0.5IOU/汽车:0.811411 PASCALBOX_性能分类/AP@0.5IOU/类别:0.831349 PASCALBOX_性能分类/AP@0.5IOU/主席:0.472102 PASCALBOX_性能分类/AP@0.5IOU/奶牛:0.790175 PASCALBOX_性能分类/AP@0.5IOU/数字表:0.483809 PASCALBOX_性能分类/AP@0.5IOU/狗只:0.819959 PASCALBOX_性能分类/AP@0.5IOU/马:0.838640 PASCALBOX_性能分类/AP@0.5IOU/摩托车:0.733901 PASCALBOX_性能分类/AP@0.5IOU/个人:0.765344 PASCALBOX_性能分类/AP@0.5IOU/盆栽植物:0.379224 PASCALBOX_性能分类/AP@0.5IOU/绵羊:0.719418 PASCALBOX_性能分类/AP@0.5IOU/沙发:0.576437 PASCALBOX_性能分类/AP@0.5IOU/列车:0.726485 PASCALBOX_性能分类/AP@0.5IOU/电视监视器:0.683094 帕斯卡卢精度/mAP@0.5IOU:0.680641

但是,当我使用原始版本(基于caffe)时,地图为0.746,细节如下: PASCALBOX_性能分类/AP@0.5IOU/飞机:0.781 PASCALBOX_性能分类/AP@0.5IOU/自行车:0.793 PASCALBOX_性能分类/AP@0.5IOU/鸟:0.756 PASCALBOX_性能分类/AP@0.5IOU/船:0.652 PASCALBOX_性能分类/AP@0.5IOU/瓶子:0.578 PASCALBOX_性能分类/AP@0.5IOU/巴士:0.843 PASCALBOX_性能分类/AP@0.5IOU/汽车:0.846 PASCALBOX_性能分类/AP@0.5IOU/类别:0.889 PASCALBOX_性能分类/AP@0.5IOU/主席:0.565 PASCALBOX_性能分类/AP@0.5IOU/奶牛:0.835 PASCALBOX_性能分类/AP@0.5IOU/diningtable:0.658 PASCALBOX_性能分类/AP@0.5IOU/狗:0.867 PASCALBOX_性能分类/AP@0.5IOU/马:0.857 PASCALBOX_性能分类/AP@0.5IOU/摩托车:0.792 PASCALBOX_性能分类/AP@0.5IOU/人数:0.778 PASCALBOX_性能分类/AP@0.5IOU/盆栽植物:0.412 PASCALBOX_性能分类/AP@0.5IOU/绵羊:0.757 PASCALBOX_性能分类/AP@0.5IOU/沙发:0.723 PASCALBOX_性能分类/AP@0.5IOU/火车:0.846 PASCALBOX_性能分类/AP@0.5IOU/电视监视器:0.684 帕斯卡卢精度/mAP@0.5IOU:0.746