detectron运行自己数据集,NotImplementedError: No evaluator for dataset: my_dataset_val错误

test

test错误:No evaluator for dataset: my_dataset_val

无论是在训练程序时,还是在运行test_net.py的时候,会出现这样的错误

NotImplementedError: No evaluator for dataset: my_dataset_val

这是由于更换了自己的数据集造成的。

解决这个错误,在对应的.yaml文件的TEST中添加一条命令就可以了。

FORCE_JSON_DATASET_VAL: True

下面是完整的文件

MODEL:
  TYPE: generalized_rcnn
  CONV_BODY: FPN.add_fpn_ResNet50_conv5_body
  NUM_CLASSES: 11
  FASTER_RCNN: True
NUM_GPUS: 1
SOLVER:
  WEIGHT_DECAY: 0.0001
  LR_POLICY: steps_with_decay
  BASE_LR: 0.001
  GAMMA: 0.1
  MAX_ITER: 20000
  STEPS: [0, 10000, 15000]
FPN:
  FPN_ON: True
  MULTILEVEL_ROIS: True
  MULTILEVEL_RPN: True
FAST_RCNN:
  ROI_BOX_HEAD: fast_rcnn_heads.add_roi_2mlp_head
  ROI_XFORM_METHOD: RoIAlign
  ROI_XFORM_RESOLUTION: 7
  ROI_XFORM_SAMPLING_RATIO: 2
TRAIN:
  WEIGHTS: https://dl.fbaipublicfiles.com/detectron/ImageNetPretrained/MSRA/R-50.pkl
  DATASETS: ('my_dataset_train',)
  SCALES: (800,)
  MAX_SIZE: 1333
  BATCH_SIZE_PER_IM: 512
  RPN_PRE_NMS_TOP_N: 2000  # Per FPN level
  SNAPSHOT_ITERS: 5000
TEST:
  DATASETS: ('my_dataset_val',)
  FORCE_JSON_DATASET_EVAL: True
  SCALE: 800
  MAX_SIZE: 1333
  NMS: 0.5
  RPN_PRE_NMS_TOP_N: 1000  # Per FPN level
  RPN_POST_NMS_TOP_N: 1000
OUTPUT_DIR: .

更改之后,运行程序就可以看到评价指标 AP,AP50,AP75,APs,APm,APl

INFO json_dataset_evaluator.py: 218: Wrote json eval results to: ./test/my_dataset_val/generalized_rc nn/detection_results.pkl
INFO task_evaluation.py:  62: Evaluating bounding boxes is done!
INFO task_evaluation.py: 181: copypaste: Dataset: my_dataset_val
INFO task_evaluation.py: 183: copypaste: Task: box
INFO task_evaluation.py: 186: copypaste: AP,AP50,AP75,APs,APm,APl
INFO task_evaluation.py: 187: copypaste: 0.5021,0.7364,0.5354,0.5929,-1.0000,-1.0000

评价指标

coco_dataset评价指标
AP就是指所有类别的平均值,被称为“平均准确度”(mAP)。这里的AP就是mAP

你可能感兴趣的:(机器学习,深度学习)