How to train PASCAL VOC 2017 in Centernet2 #5074
Unanswered
yangwenshuangshuang
asked this question in
Q&A
Replies: 1 comment
-
Your error appeared that file handling issue. Can you check that your file path to the annotations in the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I try to train PASCAL VOC 2017 in Centernet2, and the the training process is normal. However, I use PascalVOCDetectionEvaluator and meet some problems during the test phase.
Here is the code:
def do_test(cfg, model):
results = OrderedDict()
for dataset_name in cfg.DATASETS.TEST:
mapper = None if cfg.INPUT.TEST_INPUT_TYPE == 'default' else
DatasetMapper(
cfg, False, augmentations=build_custom_augmentation(cfg, False))
# print(dataset_name)
data_loader = build_detection_test_loader(cfg, dataset_name, mapper=mapper)
output_folder = os.path.join(
cfg.OUTPUT_DIR, "inference_{}".format(dataset_name))
evaluator_type = MetadataCatalog.get(dataset_name).evaluator_type
# print(evaluator_type)
if evaluator_type == "lvis":
evaluator = LVISEvaluator(dataset_name, cfg, True, output_folder)
elif evaluator_type == 'coco':
evaluator = COCOEvaluator(dataset_name, cfg, True, output_folder)
elif evaluator_type == 'pascal_voc':
evaluator = PascalVOCDetectionEvaluator(dataset_name)
else:
assert 0, evaluator_type
Here is the issue:
Traceback (most recent call last):
File "/media/ntu/volume1/home/s122md306_02/yangwenshuang/anaconda/anaconda3/envs/centernet2_new2/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 59, in _wrap
fn(i, *args)
File "/media/ntu/volume1/home/s122md306_02/yangwenshuang/detectron2/detectron2/engine/launch.py", line 123, in _distributed_worker
main_func(*args)
File "/media/ntu/volume1/home/s122md306_02/yangwenshuang/detectron2/projects/CenterNet2/train_net.py", line 234, in main
return do_test(cfg, model)
File "/media/ntu/volume1/home/s122md306_02/yangwenshuang/detectron2/projects/CenterNet2/train_net.py", line 70, in do_test
results[dataset_name] = inference_on_dataset(
File "/media/ntu/volume1/home/s122md306_02/yangwenshuang/detectron2/detectron2/evaluation/evaluator.py", line 204, in inference_on_dataset
results = evaluator.evaluate()
File "/media/ntu/volume1/home/s122md306_02/yangwenshuang/detectron2/detectron2/evaluation/pascal_voc_evaluation.py", line 102, in evaluate
rec, prec, ap = voc_eval(
File "/media/ntu/volume1/home/s122md306_02/yangwenshuang/detectron2/detectron2/evaluation/pascal_voc_evaluation.py", line 220, in voc_eval
recs[imagename] = parse_rec(annopath.format(imagename))
File "/media/ntu/volume1/home/s122md306_02/yangwenshuang/detectron2/detectron2/evaluation/pascal_voc_evaluation.py", line 135, in parse_rec
tree = ET.parse(f)
OSError: [Errno 9] Bad file descriptor
Why there is some problem with PascalVOCDetectionEvaluator?
Beta Was this translation helpful? Give feedback.
All reactions