faustomorales / vit-keras

Keras implementation of ViT (Vision Transformer)
Apache License 2.0
329 stars 78 forks source link

how to get the official pretrain model with npz format? #19

Closed knaffe closed 3 years ago

knaffe commented 3 years ago

Thanks for your great contribution! I notice you offer the VIT npz format models. How could you convert official models from JAX to NPZ?

I want to convert the Deit official models and apply into your repo. Thanks a lot again.

faustomorales commented 3 years ago

DeiT looks cool! However, this project is focused on providing a Keras implementation of the ViT models from the official repository and so a DeiT implementation would be out-of-scope. The ViT weights in this repository are the same files provided by the official repository. They're copied into the repository only for convenience and long-term reliability (i.e., in case the original files get deleted or moved). The vit_keras package just loads those NPZ weights into a Keras model using vit_keras.utils.load_weights_numpy, which works only with the ViT weights. It's not going to work with weights from any other source.