IrisRainbowNeko / RobustDet

The official PyTorch implementation of "Adversarially-Aware Robust Object Detector"
55 stars 12 forks source link

Evaluation result in VOC dataset with pre-trained model "RobustDet-VOC+CFR". #9

Open zxcver opened 1 year ago

zxcver commented 1 year ago
Dear author: Congratulations on having your paper published in 2022 ECCV Oral! Also , thanks your great project! I have encountered a problem while evaluation result in VOC dataset with pre-trained model "RobustDet-VOC+CFR". I got the result as: Method Clean Acls Aloc CWA DAG
paper 74.8 45.9 49.1 48.0 56.6
pre-trained 74.79 46.08 48.77 34.41 29.22

The results in CWA and DAG is abnormal!

The python script i used is: python eval_attack.py --cfg cfgs/RobustDet_voc.yaml --cfr True --trained_model trained_model/baseline/RobustDet-CFR_VOC_mtd.pth --data_use clean --log_folder logs/baseline --adv_type cwat

The setting i used is: Namespace(backbone='vgg', cfr=True, cfr_layer=21, amp=False, cuda=True, multi_fc=False, k_count=4, dataset='VOC', dataset_root='datasets/VOCdevkit/', data_use='clean', num_workers=8, adv_type='cwat', atk_iters=20, step_size=8, trained_model='trained_model/baseline/RobustDet-CFR_VOC_mtd.pth', save_folder='eval/', confidence_threshold=0.01, top_k=5, robust=True, con_weights=[1.0, 1.0], save_tp_fp='None', log_folder='logs/baseline')

liguopeng0923 commented 1 year ago

Has the problem been solved? I want to follow this research for my next work.

Mr-Teal commented 10 months ago

Hi! I also tried to evaluate this pretrained model but failed. While running the code, warnings similar to this one ....../box_utils.py:219: UserWarning: An output with one or more elements was resized since it had shape [145], which does not match the required output shape [131]. This behavior is deprecated, and in a future PyTorch release outputs will not be resized unless they have zero elements. You can explicitly reuse an out tensor t by resizing it, inplace, to zero elements with t.resize_(0). (Triggered internally at /opt/conda/conda-bld/pytorch_1695392022560/work/aten/src/ATen/native/Resize.cpp:28.) torch.index_select(y2, 0, idx, out=yy2) keeps popping out. And after waiting for the running process to finish, it says that

Traceback (most recent call last):  
  File "....../RobustDet-master/eval_attack.py", line 533, in <module>
    test_net_attack(args.save_folder, net, args.cuda, dataset_adv, adv_type)
  File "....../RobustDet-master/eval_attack.py", line 415, in test_net_attack
    evaluate_detections_voc(all_boxes, output_dir, dataset)
  File "....../RobustDet-master/eval_attack.py", line 420, in evaluate_detections_voc
    write_voc_results_file(box_list, dataset)
  File "....../RobustDet-master/eval_attack.py", line 118, in write_voc_results_file
    if dets == []:
ValueError: operands could not be broadcast together with shapes (12,5) (0,)

Could anyone help with this? Thanks a lot!

wmrenr commented 5 months ago

Hi! I also tried to evaluate this pretrained model but failed. While running the code, warnings similar to this one ....../box_utils.py:219: UserWarning: An output with one or more elements was resized since it had shape [145], which does not match the required output shape [131]. This behavior is deprecated, and in a future PyTorch release outputs will not be resized unless they have zero elements. You can explicitly reuse an out tensor t by resizing it, inplace, to zero elements with t.resize_(0). (Triggered internally at /opt/conda/conda-bld/pytorch_1695392022560/work/aten/src/ATen/native/Resize.cpp:28.) torch.index_select(y2, 0, idx, out=yy2) keeps popping out. And after waiting for the running process to finish, it says that

Traceback (most recent call last):  
  File "....../RobustDet-master/eval_attack.py", line 533, in <module>
    test_net_attack(args.save_folder, net, args.cuda, dataset_adv, adv_type)
  File "....../RobustDet-master/eval_attack.py", line 415, in test_net_attack
    evaluate_detections_voc(all_boxes, output_dir, dataset)
  File "....../RobustDet-master/eval_attack.py", line 420, in evaluate_detections_voc
    write_voc_results_file(box_list, dataset)
  File "....../RobustDet-master/eval_attack.py", line 118, in write_voc_results_file
    if dets == []:
ValueError: operands could not be broadcast together with shapes (12,5) (0,)

Could anyone help with this? Thanks a lot!

May I ask if you have resolved it? I also encountered the same problem!