Skip to content
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

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

Open
wan3333 opened this issue Nov 12, 2023 · 11 comments
Open

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

wan3333 opened this issue Nov 12, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@wan3333
Copy link

wan3333 commented Nov 12, 2023

✨ 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 wan3333 added the bug Something isn't working label Nov 12, 2023
@rikonaka
Copy link
Contributor

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? 😉

@wan3333
Copy link
Author

wan3333 commented Nov 12, 2023 via email

@rikonaka
Copy link
Contributor

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

@qqt-code
Copy link

I also have this bug

@rikonaka
Copy link
Contributor

I also have this bug

Which specific file are you having trouble with?

@qqt-code
Copy link

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.

@rikonaka
Copy link
Contributor

rikonaka commented Jan 17, 2024

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 😘.

@Gorgerbin
Copy link

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?

@rikonaka
Copy link
Contributor

rikonaka commented Feb 13, 2024

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:

😘😘😘

@pingguokiller
Copy link

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
Copy link

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}".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants