nmndeep / revisiting-at

[NeurIPS 2023] Code for the paper "Revisiting Adversarial Training for ImageNet: Architectures, Training and Generalization across Threat Models"
37 stars 3 forks source link

loading a pretrained chekpoint #7

Open royg27 opened 7 months ago

royg27 commented 7 months ago

Hello,

First of all - thanks for the great work! After downloading it from the link, I am trying to load a given checkpoint. However, the load command fails - torch.load('convnext_b_cvst_robust.pt', map_location='cpu') and outputs the following error: RuntimeError: Expected hasRecord("version") to be true, but got false. More details - I use the same torch version as required, and I have tried several different checkpoints. How can I resolve this?

Thanks!

nmndeep commented 7 months ago

Hi, Thanks for using our models, seems to be a version issue with torch. Some people have reported this for other intances: here

I was able to load the same checkpoint in my current torch version, can you try with this?

Screenshot 2024-02-27 at 10 56 43

royg27 commented 7 months ago

Thanks for your reply. I have tried your solution and a few other torch + cuda combinations, but it doesn't help. Can you please provide an environment setup file (pip or conda)?

image

nmndeep commented 7 months ago

main_py.yml.zip Here is my environment - works for me here, hope this helps.