Skip to content

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

Description

@break0123

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions