adversarial-attacks-pytorch icon indicating copy to clipboard operation
adversarial-attacks-pytorch copied to clipboard

The model loading in the demo seems to have become inactive[BUG]

Open wan3333 opened this issue 2 years ago • 11 comments

✨ Short description of the bug [tl;dr]

The model loading in the demo seems to have become inactive

💬 Detailed code and results

model = load_model('Standard', norm='Linf').to(device) It seems cant load the model.

wan3333 avatar Nov 12 '23 06:11 wan3333

Hi @wan3333 , if you are a user in mainland China, please add a proxy when running the demo code...because some of the pre-trained models need to be downloaded from the Google driver.

If not, could you please provide the complete code? 😉

rikonaka avatar Nov 12 '23 17:11 rikonaka

Yes, I have proxy, the complete code is in this repository’s demo directory, you can check it.

------------------ Original ------------------ From: isinstance @.> Date: Mon,Nov 13,2023 1:35 AM To: Harry24k/adversarial-attacks-pytorch @.> Cc: WAN @.>, Mention @.> Subject: Re: [Harry24k/adversarial-attacks-pytorch] The model loading in thedemo seems to have become inactive[BUG] (Issue #166)

wan3333 avatar Nov 12 '23 17:11 wan3333

Yes, I have proxy, the complete code is in this repository’s demo directory, you can check it. ------------------ Original ------------------ From: isinstance @.> Date: Mon,Nov 13,2023 1:35 AM To: Harry24k/adversarial-attacks-pytorch @.> Cc: WAN @.>, Mention @.> Subject: Re: [Harry24k/adversarial-attacks-pytorch] The model loading in thedemo seems to have become inactive[BUG] (Issue #166)

I can't reproduce the problem you raised.

ret

rikonaka avatar Nov 12 '23 18:11 rikonaka

I also have this bug

qqt-code avatar Jan 15 '24 07:01 qqt-code

I also have this bug

Which specific file are you having trouble with?

rikonaka avatar Jan 16 '24 13:01 rikonaka

image In the demo of White-box Attack on CIFAR10,I download this model,and the content of it is above,so I can't load it.For this problem,i have switched two python version,first one can't download,and second one is the above result. I want to know if it's my operational mistake.

qqt-code avatar Jan 17 '24 06:01 qqt-code

image In the demo of White-box Attack on CIFAR10,I download this model,and the content of it is above,so I can't load it.For this problem,i have switched two python version,first one can't download,and second one is the above result. I want to know if it's my operational mistake.

May I ask what is the size of your Standard.pt file?

I seem to have figured out why, there was a bug in robustbench download function from google driver, and that seems to have just been fixed, but the files included in torchattacks were not updated to the latest version of robustbench.

Please delete the robustbench folder in torchattacks and reclone from this repository https://github.com/RobustBench/robustbench.git, or reinstall it via pip uninstall robustbench then pip install git+https://github.com/RobustBench/robustbench.git , then it should work 😘.

rikonaka avatar Jan 17 '24 06:01 rikonaka

image In the demo of White-box Attack on CIFAR10,I download this model,and the content of it is above,so I can't load it.For this problem,i have switched two python version,first one can't download,and second one is the above result. I want to know if it's my operational mistake.

do you resolve this problem please?

Gorgerbin avatar Feb 13 '24 10:02 Gorgerbin

Hi @Gorgerbin @qqt-code @wan3333 , it seems that the problem is caused by the robustbench library, so until the problem is fixed upstream, you can test it with this new demo code: https://colab.research.google.com/drive/1atyo82sYeaZsbudgjt7jo25Cuv6ArzKB?usp=sharing or here: new_demo.zip

This requires three files, one for the trained model (resnet18_eval.pth) and two for the image and label (images.pth and labels.pth). These three files you can download from here:

  • model https://github.com/rikonaka/adversarial-attacks-pytorch/raw/master/code_coverage/resnet18_eval.pth

  • images https://github.com/rikonaka/adversarial-attacks-pytorch/raw/master/code_coverage/images.pth

  • labels https://github.com/rikonaka/adversarial-attacks-pytorch/raw/master/code_coverage/labels.pth

😘😘😘

rikonaka avatar Feb 13 '24 15:02 rikonaka

I have the same problem.

In 'robustbench/utils.py': 'response = session.get(url_base, params={'id': gdrive_id}, stream=True)', when downloading the .pt file, google would give the warning info to ask you to confirm. So it downloads a file with html instead of the real pt file.

1712756824936

pingguokiller avatar Apr 10 '24 13:04 pingguokiller

I have the same problem.

In 'robustbench/utils.py': 'response = session.get(url_base, params={'id': gdrive_id}, stream=True)', when downloading the .pt file, google would give the warning info to ask you to confirm. So it downloads a file with html instead of the real pt file.

1712756824936

You can manually download the .pt file with url "https://docs.google.com/uc?export=download&confirm=t&id={gdrive_id}".

pingguokiller avatar Apr 10 '24 13:04 pingguokiller