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

Errors when loading the model #177

Open
linghunwhp opened this issue Mar 23, 2024 · 3 comments
Open

Errors when loading the model #177

linghunwhp opened this issue Mar 23, 2024 · 3 comments

Comments

@linghunwhp
Copy link

When loading a model, it downloads from Google Drive, it downloads a .pt file but just contains html content of download verification page like the following screenshot. And then, it leads to some errors when loading the downloaded model. Do you know how to fix this problem?
By the way, did you provide models with the TensorFlow framework or do you have a method to transfer the Pytorch model to the Tensorflow model?

download_verification

Traceback (most recent call last):
File "D:\My_Project\ContextFuzz\AdvTrainedModelFuzzing.py", line 57, in
model = load_model(model_name='Carmon2019Unlabeled', model_dir=ae_trained_model_path, dataset='cifar10', threat_model='Linf')
File "C:\Users\haipewang5\Anaconda3\envs\tensorflow_11\lib\site-packages\robustbench\utils.py", line 147, in load_model
checkpoint = torch.load(model_path, map_location=torch.device('cpu'))
File "C:\Users\haipewang5\Anaconda3\envs\tensorflow_11\lib\site-packages\torch\serialization.py", line 1040, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\haipewang5\Anacond
a3\envs\tensorflow_11\lib\site-packages\torch\serialization.py", line 1258, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '<'.

@fra31
Copy link
Member

fra31 commented Mar 23, 2024

Hi,

the issue about loading should have been solved with #175 (you'll probably need to install the latest version and remove the corrupted checkpoints).

We don't provide TF models, and only support PyTorch models. However, if you want to evaluate a TF model you can directly use AutoAttack from here.

Hope this helps!

@linghunwhp
Copy link
Author

I am quite appreciative of your instant response. I want to find some robust wild TF model, such as adversarially retrained or augmented models. Do you know such an official repository or wildly used models? Thanks a lot and waiting for your response.

@fra31
Copy link
Member

fra31 commented Mar 24, 2024

You can find a couple here, but there should be more around (just I'm not aware of a centralized collection).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants