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 use of pretrain weights in adversarial training #1
Comments
Here is the error detail under env:torch==1.9.0 5 frames /content/drive/My Drive/Colab Notebooks/on-the-adversarial-robustness-of-visual-transformer-master/training/timm_vit/vit.py in _create_vision_transformer(variant, pretrained, distilled, **kwargs) /usr/local/lib/python3.7/dist-packages/timm/models/helpers.py in load_pretrained(model, default_cfg, num_classes, in_chans, filter_fn, strict, progress) /usr/local/lib/python3.7/dist-packages/torch/hub.py in load_state_dict_from_url(url, model_dir, map_location, progress, check_hash, file_name) /usr/local/lib/python3.7/dist-packages/torch/serialization.py in load(f, map_location, pickle_module, **pickle_load_args) /usr/local/lib/python3.7/dist-packages/torch/serialization.py in init(self, name_or_buffer) RuntimeError: Expected hasRecord("version") to be true, but got false. (Could this error message be improved? If so, please report an enhancement request to PyTorch.) |
Hi @caposerenity , what is the version of |
Thank you, it really helps! |
Hi @RulinShao , thanks a lot, for your impressive work.
I'm trying to reproduce some of your experiments, I notice that in this repo you use timm for the pretrained version of vit-16. When I try to do the training process like you did in train.py, it seems that I fail with loading the pretrained weights of vit_base_patch16_224_in21k.
The details of error : RuntimeError: Expected hasRecord("version") to be true, but got false.
env: torch==1.9.0 torchvision==0.10.0 running on Colab
I also tried older versions of torch, they all failed with loading pretrain weights with other error information like" Only one file(not dir) is allowed in the zipfile", it seems that the problem is about the compressed weights in zip format used in timm
Could you please tell me the environment you use when implementing this work?
thanks a lot!
The text was updated successfully, but these errors were encountered: