robustbench icon indicating copy to clipboard operation
robustbench copied to clipboard

Errors when loading the model

Open linghunwhp opened this issue 1 year ago • 3 comments

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, '<'.

linghunwhp avatar Mar 23 '24 09:03 linghunwhp

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!

fra31 avatar Mar 23 '24 15:03 fra31

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.

linghunwhp avatar Mar 24 '24 08:03 linghunwhp

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

fra31 avatar Mar 24 '24 15:03 fra31

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

fra31 avatar Jun 20 '24 15:06 fra31

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

linghunwhp avatar Jun 20 '24 15:06 linghunwhp