Skip to content

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

@break0123

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?

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