Run this model with HF Jobs
Run zeromodels/tf_efficientnetv2_b3_in1k on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/zeromodels/tf_efficientnetv2_b3_in1k. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/zeromodels/tf_efficientnetv2_b3_in1k on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use zeromodels/tf_efficientnetv2_b3_in1k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/tf_efficientnetv2_b3_in1k with ZeroModels:
# pip install -U zeromodels # ZeroModels is pure Keras 3, so pick a backend: "jax", "torch" or "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" from zeromodels import AutoZModel # AutoZModel reads the repo's model_type and loads the matching class. # For a task head use the matching loader, e.g. AutoZMImageClassify / AutoZMDetect / # AutoZMSemanticSegment / AutoZMTextGenerate (see zeromodels.auto). model = AutoZModel.from_weights("zeromodels/tf_efficientnetv2_b3_in1k") - Keras
How to use zeromodels/tf_efficientnetv2_b3_in1k with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://zeromodels/tf_efficientnetv2_b3_in1k") - Notebooks
- Google Colab
- Kaggle
fix readme.md
Browse files7 unmodified lines891011121314151617181920212223242526277 unmodified lines- kerasformers- image-classification- efficientnetv2- pytorch- jax- tf---# tf_efficientnetv2_b3_in1kPure-Keras 3 image-classification weight for [kerasformers](https://github.com/IMvision12/KerasFormers), converted from [timm/tf_efficientnetv2_b3.in1k](https://huggingface.co/timm/tf_efficientnetv2_b3.in1k).## Usage```pythonfrom kerasformers.models.efficientnetv2 import EfficientNetV2ImageClassifymodel = EfficientNetV2ImageClassify.from_weights("tf_efficientnetv2_b3_in1k")```License: **apache-2.0**, inherited from the upstream source.7 unmodified lines89101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990917 unmodified lines- kerasformers- image-classification- efficientnetv2- backbone- arxiv:2104.00298- pytorch- jax- tf---## ***See [our collection](https://huggingface.co/collections/kerasformers/efficientnetv2-6a6d11b8c2748868ecfd4f9e) for all versions of EfficientNetV2.***# Run EfficientNetV2 with Keras 3: JAX, PyTorch, or TensorFlow[](https://github.com/IMvision12/KerasFormers) [](https://imvision12.github.io/KerasFormers/classification_backbones/) [](https://huggingface.co/collections/kerasformers/efficientnetv2-6a6d11b8c2748868ecfd4f9e)# kerasformers/tf_efficientnetv2_b3_in1kPaper: [EfficientNetV2: Smaller Models and Faster Training (arXiv:2104.00298)](https://arxiv.org/abs/2104.00298) · [HF Papers](https://huggingface.co/papers/2104.00298)EfficientNetV2 trains faster with Fused-MBConv and progressive learning. Same ImageClassify / Model API as EfficientNet.For more details on the model, please go to the upstream [model card](https://huggingface.co/timm/tf_efficientnetv2_b3.in1k).Pure-**Keras 3** conversion of [`timm/tf_efficientnetv2_b3.in1k`](https://huggingface.co/timm/tf_efficientnetv2_b3.in1k) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.This is an **image-classification / backbone** checkpoint (`EfficientNetV2ImageClassify` / `EfficientNetV2Model`).## ✨ Quick start```pythonimport osos.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"from PIL import Imageimport numpy as npfrom kerasformers.models.efficientnetv2 import EfficientNetV2ImageClassify, EfficientNetV2Modelmodel = EfficientNetV2ImageClassify.from_weights("kerasformers/tf_efficientnetv2_b3_in1k")backbone = EfficientNetV2Model.from_weights("kerasformers/tf_efficientnetv2_b3_in1k", as_backbone=True)image = Image.open("your_image.jpg").convert("RGB")image = image.resize((224, 224))x = np.asarray(image, dtype="float32")[None] # (1, H, W, 3)print(model(x).shape) # (1, num_classes)feats = backbone(x)print(len(feats), [tuple(f.shape) for f in feats])```Load any EfficientNetV2 variant the same way with `from_weights("kerasformers/<variant>")`:| Variant | Hub ||---|---|| `tf_efficientnetv2_b0_in1k` | [`kerasformers/tf_efficientnetv2_b0_in1k`](https://huggingface.co/kerasformers/tf_efficientnetv2_b0_in1k) || `tf_efficientnetv2_b1_in1k` | [`kerasformers/tf_efficientnetv2_b1_in1k`](https://huggingface.co/kerasformers/tf_efficientnetv2_b1_in1k) || `tf_efficientnetv2_b2_in1k` | [`kerasformers/tf_efficientnetv2_b2_in1k`](https://huggingface.co/kerasformers/tf_efficientnetv2_b2_in1k) || `tf_efficientnetv2_b3_in1k` | [`kerasformers/tf_efficientnetv2_b3_in1k`](https://huggingface.co/kerasformers/tf_efficientnetv2_b3_in1k) || `tf_efficientnetv2_b3_in21k_ft_in1k` | [`kerasformers/tf_efficientnetv2_b3_in21k_ft_in1k`](https://huggingface.co/kerasformers/tf_efficientnetv2_b3_in21k_ft_in1k) || `tf_efficientnetv2_l_in1k` | [`kerasformers/tf_efficientnetv2_l_in1k`](https://huggingface.co/kerasformers/tf_efficientnetv2_l_in1k) || `tf_efficientnetv2_l_in21k` | [`kerasformers/tf_efficientnetv2_l_in21k`](https://huggingface.co/kerasformers/tf_efficientnetv2_l_in21k) || `tf_efficientnetv2_l_in21k_ft_in1k` | [`kerasformers/tf_efficientnetv2_l_in21k_ft_in1k`](https://huggingface.co/kerasformers/tf_efficientnetv2_l_in21k_ft_in1k) || `tf_efficientnetv2_m_in1k` | [`kerasformers/tf_efficientnetv2_m_in1k`](https://huggingface.co/kerasformers/tf_efficientnetv2_m_in1k) || `tf_efficientnetv2_m_in21k` | [`kerasformers/tf_efficientnetv2_m_in21k`](https://huggingface.co/kerasformers/tf_efficientnetv2_m_in21k) || `tf_efficientnetv2_m_in21k_ft_in1k` | [`kerasformers/tf_efficientnetv2_m_in21k_ft_in1k`](https://huggingface.co/kerasformers/tf_efficientnetv2_m_in21k_ft_in1k) || `tf_efficientnetv2_s_in1k` | [`kerasformers/tf_efficientnetv2_s_in1k`](https://huggingface.co/kerasformers/tf_efficientnetv2_s_in1k) || `tf_efficientnetv2_s_in21k` | [`kerasformers/tf_efficientnetv2_s_in21k`](https://huggingface.co/kerasformers/tf_efficientnetv2_s_in21k) || `tf_efficientnetv2_s_in21k_ft_in1k` | [`kerasformers/tf_efficientnetv2_s_in21k_ft_in1k`](https://huggingface.co/kerasformers/tf_efficientnetv2_s_in21k_ft_in1k) || `tf_efficientnetv2_xl_in21k` | [`kerasformers/tf_efficientnetv2_xl_in21k`](https://huggingface.co/kerasformers/tf_efficientnetv2_xl_in21k) || `tf_efficientnetv2_xl_in21k_ft_in1k` | [`kerasformers/tf_efficientnetv2_xl_in21k_ft_in1k`](https://huggingface.co/kerasformers/tf_efficientnetv2_xl_in21k_ft_in1k) |## Tips- Set `KERAS_BACKEND` **before** importing Keras / kerasformers.- `EfficientNetV2ImageClassify` returns class logits; `EfficientNetV2Model` returns features (`as_backbone=True` for multi-scale stages).- See [docs](https://imvision12.github.io/KerasFormers/classification_backbones/) and [Loading Weights](https://imvision12.github.io/KerasFormers/loading_weights/).- Upstream / timm checkpoints: `EfficientNetV2ImageClassify.from_weights("hf:timm/tf_efficientnetv2_b3.in1k")`.## Special ThanksA huge thank you to the EfficientNetV2 authors and the timm / Hub communities for creating and releasing these models.License: see YAML `license` (usually matches the upstream checkpoint).
README.md+70-6