martinsbruveris / tensorflow-image-models

TensorFlow port of PyTorch Image Models (timm) - image models with pretrained weights.
https://tfimm.readthedocs.io/en/latest/
Apache License 2.0
286 stars 25 forks source link

Lora create model #87

Closed martinsbruveris closed 1 year ago

martinsbruveris commented 1 year ago

Adding create_model function and setting up some form of registry. To create a LoRA model for a supported architecture, use

from tfimm.architectures import lora

model = lora.create_model("convnext_tiny", pretrained=True, lora_rank=4)
lora.mark_only_lora_as_trainable(model, train_bias="none")