RobustBench / robustbench

RobustBench: a standardized adversarial robustness benchmark [NeurIPS 2021 Benchmarks and Datasets Track]
https://robustbench.github.io
Other
671 stars 99 forks source link

Errors when loading the model #177

Closed linghunwhp closed 5 months ago

linghunwhp commented 8 months ago

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 commented 8 months ago

Hi,

the issue about loading should have been solved with https://github.com/RobustBench/robustbench/pull/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 commented 8 months ago

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 commented 8 months ago

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

fra31 commented 5 months ago

Closing this for now, feel free to re-open if you have more questions.

linghunwhp commented 5 months ago

这是来自QQ邮箱的假期自动回复邮件。你好,来信已经收到,尽快给你回复。