LiangSiyuan21 / Adversarial-Attacks-for-Image-and-Video-Object-Detection

A Implementation of IJCAI-19(Transferable Adversarial Attacks for Image and Video Object Detection)
90 stars 21 forks source link

AttributeError: 'Blade_runner' object has no attribute 'perturb_mD_img' #1

Open gmt710 opened 5 years ago

gmt710 commented 5 years ago

Hi,Thanks for your sharing.I run test.py .I encountered a problem and solved it.

Error:AttributeError: 'Blade_runner' object has no attribute 'perturb_mD_img' line 357

adv_img, perturb, distance = 
 trainer.attacker.perturb_mD_img(img,save_perturb=save_path_perturb, rois=rois, roi_scores=roi_scores)

change to:

adv_img, perturb, distance = 
trainer.attacker.perturb(img, save_perturb=save_path_perturb, rois=rois, roi_scores=roi_scores)

Hope it's useful to others.

xubo0321 commented 5 years ago

Hi,Thanks for your sharing.I run test.py .I encountered a problem and solved it.

Error:AttributeError: 'Blade_runner' object has no attribute 'perturb_mD_img' line 357

adv_img, perturb, distance = 
 trainer.attacker.perturb_mD_img(img,save_perturb=save_path_perturb, rois=rois, roi_scores=roi_scores)

change to:

adv_img, perturb, distance = 
trainer.attacker.perturb(img, save_perturb=save_path_perturb, rois=rois, roi_scores=roi_scores)

Hope it's useful to others. @gmt710 Thanks a lot, but why.

xubo0321 commented 5 years ago

Hi,Thanks for your sharing.I run test.py .I encountered a problem and solved it.

Error:AttributeError: 'Blade_runner' object has no attribute 'perturb_mD_img' line 357

adv_img, perturb, distance = 
 trainer.attacker.perturb_mD_img(img,save_perturb=save_path_perturb, rois=rois, roi_scores=roi_scores)

change to:

adv_img, perturb, distance = 
trainer.attacker.perturb(img, save_perturb=save_path_perturb, rois=rois, roi_scores=roi_scores)

Hope it's useful to others.

@gmt710 I know, Thank you.

zikuicai commented 4 years ago

Hi,Thanks for your sharing.I run test.py .I encountered a problem and solved it.

Error:AttributeError: 'Blade_runner' object has no attribute 'perturb_mD_img' line 357

adv_img, perturb, distance = 
 trainer.attacker.perturb_mD_img(img,save_perturb=save_path_perturb, rois=rois, roi_scores=roi_scores)

change to:

adv_img, perturb, distance = 
trainer.attacker.perturb(img, save_perturb=save_path_perturb, rois=rois, roi_scores=roi_scores)

Hope it's useful to others.

Thanks for the solution.

I have another error in the same function call. In the calAttentionMask function. It has roi_weight = np.ones((h, w)) * roi_scores[i] and in my case roi_scores is a torch tensor with size torch.Size([300, 21])), which does not match with the dimension of np.ones((h, w)). I was curious what exactly is this function doing. Did you have the same issue and how did you solve it? Thanks in advance!