scuwyh2000 / RandBox

[ICCV 2023] PyTorch implementation of RandBox
http://arxiv.org/abs/2307.08249
52 stars 5 forks source link

evaluation error #9

Closed AgreeW closed 1 year ago

AgreeW commented 1 year ago

Hi, I got a error when run run_eval.sh, can you give me some help?


Traceback (most recent call last):
  File "train_net.py", line 376, in <module>
    launch(
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/detectron2/engine/launch.py", line 67, in launch
    mp.spawn(
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 230, in spawn
    return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 188, in start_processes
    while not context.join():
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 150, in join
    raise ProcessRaisedException(msg, error_index, failed_process.pid)
torch.multiprocessing.spawn.ProcessRaisedException: 

-- Process 0 terminated with the following error:
Traceback (most recent call last):
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 59, in _wrap
    fn(i, *args)
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/detectron2/engine/launch.py", line 126, in _distributed_worker
    main_func(*args)
  File "/mnt/home/wls/RandBox/train_net.py", line 359, in main
    res = Trainer.ema_test(cfg, model)
  File "/mnt/home/wls/RandBox/train_net.py", line 261, in ema_test
    results = cls.test(cfg, model, evaluators=evaluators)
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 608, in test
    results_i = inference_on_dataset(model, data_loader, evaluator)
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/detectron2/evaluation/evaluator.py", line 204, in inference_on_dataset
    results = evaluator.evaluate()
  File "/mnt/home/wls/RandBox/randbox/pascal_voc_evaluation.py", line 189, in evaluate
    rec, prec, ap, unk_det_as_known, num_unk, tp_plus_fp_closed_set, fp_open_set = voc_eval(
  File "/mnt/home/wls/RandBox/randbox/pascal_voc_evaluation.py", line 456, in voc_eval
    R = class_recs[str(mapping[int(image_ids[d])])]
KeyError: '009122'
scuwyh2000 commented 1 year ago

Hi, I got a error when run run_eval.sh, can you give me some help?

Traceback (most recent call last):
  File "train_net.py", line 376, in <module>
    launch(
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/detectron2/engine/launch.py", line 67, in launch
    mp.spawn(
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 230, in spawn
    return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 188, in start_processes
    while not context.join():
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 150, in join
    raise ProcessRaisedException(msg, error_index, failed_process.pid)
torch.multiprocessing.spawn.ProcessRaisedException: 

-- Process 0 terminated with the following error:
Traceback (most recent call last):
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 59, in _wrap
    fn(i, *args)
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/detectron2/engine/launch.py", line 126, in _distributed_worker
    main_func(*args)
  File "/mnt/home/wls/RandBox/train_net.py", line 359, in main
    res = Trainer.ema_test(cfg, model)
  File "/mnt/home/wls/RandBox/train_net.py", line 261, in ema_test
    results = cls.test(cfg, model, evaluators=evaluators)
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 608, in test
    results_i = inference_on_dataset(model, data_loader, evaluator)
  File "/mnt/home/wls/anaconda3/envs/randbox/lib/python3.8/site-packages/detectron2/evaluation/evaluator.py", line 204, in inference_on_dataset
    results = evaluator.evaluate()
  File "/mnt/home/wls/RandBox/randbox/pascal_voc_evaluation.py", line 189, in evaluate
    rec, prec, ap, unk_det_as_known, num_unk, tp_plus_fp_closed_set, fp_open_set = voc_eval(
  File "/mnt/home/wls/RandBox/randbox/pascal_voc_evaluation.py", line 456, in voc_eval
    R = class_recs[str(mapping[int(image_ids[d])])]
KeyError: '009122'

Do you have this directory? image

AgreeW commented 1 year ago

Yeah, and 009122.xml is in Annotations/

image

image

scuwyh2000 commented 1 year ago

Yeah, and 009122.xml is in Annotations/

image

image

OK, can you send your pascal_voc_evaluation.py to my email: scuwyh2000@gmail.com I'll try to figure it out. Thanks!

AgreeW commented 1 year ago

Actually, I only modified np.bool to np.bool_ of pascal_voc_evaluation.py. Other than that, nothing in the source file has been changed. Is it related to this?

scuwyh2000 commented 1 year ago

Actually, I only modified np.bool to np.bool_ of pascal_voc_evaluation.py. Other than that, nothing in the source file has been changed. Is it related to this?

I think there is possibility. You can check other details or downgrade the version of numpy. Referring issue #8, others can run it successfully.

scuwyh2000 commented 1 year ago

I think you can debug it (e.g. print the 'class_recs' dict), there may be a path issue. Because I clone my code and it can run successfully. @AgreeW