Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are weights other than imagenet used? #52

Open
tristandb8 opened this issue Sep 9, 2024 · 1 comment
Open

Are weights other than imagenet used? #52

tristandb8 opened this issue Sep 9, 2024 · 1 comment

Comments

@tristandb8
Copy link

Hi,

I'm interested in:
https://huggingface.co/timm/tf_efficientnet_b7.ns_jft_in1k

The efficientnet model is available in keras, but I'm interested in the advanced pretrained weights used here.
When I load kimm.models.EfficientNetB7(), I get
Downloading data from https://github.com/james77777778/keras-image-models/releases/download/0.1.0/efficientnetb7_tf_efficientnet_b7.ns_jft_in1k.keras

Which seems great to me as tf_efficientnet_b7.ns_jft_in1k is what I'm interested in.

In this repo kimm/_src/models/efficientnet.py I see
class EfficientNetB7(EfficientNetVariant):
available_weights = [
(
"imagenet",
EfficientNet.default_origin,
"efficientnetb7_tf_efficientnet_b7.ns_jft_in1k.keras",
)
]

But I can't kimm.models.EfficientNetB7("efficientnetb7_tf_efficientnet_b7.ns_jft_in1k.keras")
It tells me the only weights available are "imagenet"
And I only see
add_model_to_registry(EfficientNetB7, "imagenet")

I'm assuming you loaded EfficientNetB7 with tf_efficientnet_b7.ns_jft_in1k but mislabeled it as imagenet?

Would be helpful to know which weights I'm actually working with.

Thanks for the awesome work by the way.

@james77777778
Copy link
Owner

Hey @tristandb8
Thanks for your kind words!

Actually, kimm.models.EfficientNetB7() loads "efficientnetb7_tf_efficientnet_b7.ns_jft_in1k". I renamed it to "imagenet" to simplify the naming convention.
You can check this script, which includes a correctness check:
https://github.com/james77777778/keras-image-models/blob/main/tools/convert_efficientnet_from_timm.py

Let me know if you encounter any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants