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

How can I use imagenet21k+imagenet2012/ViT-B_16.npz to inference #307

Open
break0123 opened this issue Jul 31, 2024 · 0 comments
Open

How can I use imagenet21k+imagenet2012/ViT-B_16.npz to inference #307

break0123 opened this issue Jul 31, 2024 · 0 comments

Comments

@break0123
Copy link

I downloaded the model:
wget https://storage.googleapis.com/vit_models/imagenet21k+imagenet2012/ViT-B_16.npz -O ViT-B_16_imagenet2012.npz
And I use the following code to load the model:

model_name = 'ViT-L_16' 
model_config = models_config.MODEL_CONFIGS[model_name]
model = models.VisionTransformer(num_classes=1000, **model_config)
params = checkpoint.load(f'./test_result/{model_name}_imagenet2012.npz')

An error occurred while running:
ValueError: Cannot load file containing pickled data when allow_pickle=False
Please help me, how do I load a trained model?

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

1 participant