-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seeking Help with an Issue #2
Comments
I noticed that there is a custom normalize function in utils/misc.py. Can I use this one instead? |
I tried to replace from mmdet.apis.test import normalize with from utils.misc import normalize. Although your code ran without errors, the generated perturbed images were completely black, and all the losses were nan. This doesn't work.So, what should I do to resolve this issue? |
Hello @ZeoLuuuuuu , Could you try the following library version and check whether it works?
|
Thank you very much for your reply. I have modified it according to your version, but unfortunately, it still does not work properly. It seems that the way the normalize() function is imported is incorrect. I could not find this function based on the import way you used in the official mmdet documentation with any versions. |
Hello @ZeoLuuuuuu , You're absolutely right—the function is missing in the current code. Thanks for catching that! I've just fixed the issue. You can either update the code to the latest version or check out the modifications here. Hope this helps! Let me know if you run into any other issues. |
Thank you very much for the fix. Following your modifications, I have managed to resolve this issue on my end as well. I don’t have any further questions for now, but I will let you know if anything else comes up. |
Hello, @WindVChen , Namespace(train=False, resolution=512, image_path=None, save_path='./logs\exp5', seed=42, wandb=False, image_root='images', batch_size=8, dataloader_num_workers=12, iterations=1000, lr=1e-05, LUT_dim=7, lut_path='LUTs', save_visualization=True, save_path_lut='model/best.pth', attack_image_root='attacked_image', lut_apply=True, is_eot=True, det_model_config='det_configs/roi_trans_r50_fpn_1x_dota_le90.py', patch_size=40, attack_epochs=10, attack_pos='corner', tv_weight=100, nps_weight=0.0, det_model_checkpoint='pretrained/roi_trans_r50_fpn_1x_dota_le90-d1f0b77a.pth') INFO:root:Finish DOTA image split. load checkpoint from local path: pretrained/roi_trans_r50_fpn_1x_dota_le90-d1f0b77a.pth INFO:root:Start to save clean images (only those with targets)! Start to save perturbations and perturbed images! INFO:root:Start to save perturbations and perturbed images! Start to save merged full perturbed image! INFO:root:Start to save merged full perturbed image! Start to save perturbations and perturbed images! INFO:root:Start to save perturbations and perturbed images! Start to save merged full perturbed image! INFO:root:Start to save merged full perturbed image! Evaluate the clean images ... INFO:root:Evaluate the clean images ... load checkpoint from local path: pretrained/roi_trans_r50_fpn_1x_dota_le90-d1f0b77a.pth INFO:root:Evaluate the perturbed images ... It must be that I’m not familiar in running your program, and there should be some mistakes on my part. Could you please help me take a look on the information I provided and give me some modifications? I would be grateful if you could help me do that. |
Hi, I guess it may be because the sampled images do not include any valid objects. I notice there are messages in your log as follows:
|
Hi, |
That is a bit weird. Could you check whether there is any object in the label file? Or if the label file is under the same file structure as follows?
Since from the information in your logs, it seems there are objects detected by the networks, but there are no groundtruth objects:
|
Thank you so much. I finally managed to do it. I didn't place the label file according to the file structure you provided, which was a minor mistake. Start attacking detection model. |
The error message is as follows:
Traceback (most recent call last):
File "D:\Detection_code\VCO-AP-master\main.py", line 17, in
from attacking import attack
File "D:\Detection_code\VCO-AP-master\attacking.py", line 10, in
from mmdet.apis.test import normalize
ImportError: cannot import name 'normalize' from 'mmdet.apis.test' (D:\Anaconda3\envs\adv_defense\lib\site-packages\mmdet\apis\test.py)
I encountered an issue where the imported function could not be found while running your codes. The specific location is in line 10 of attacking.py: from mmdet.apis.test import normalize. My version of mmdet is 2.28.2, and only this imported function is missing. In your requirements.txt, the version of mmdet is specified as 3.2.0. However, after I changed to install version 3.2.0, I found that even more imported functions were missing. Could you please advise on how to resolve this issue? Thank you!
The text was updated successfully, but these errors were encountered: