Vision encoder mobilenetv5_300m_enc is not uploaded to transformers?
when I try to run the model on colab it gives me this error
RuntimeError: Unknown model (mobilenetv5_300m_enc) even after following the exact usage instructions. but when I run the same model on Kaggle with its usage instructions it is working perfectly.
timm>=1.0.16 is required,
pip install timm>=1.0.16 fixes the problem for me
Same error running on colab (GPU T4)
pip install timm>=1.0.16 doesnt fixed.
Other suggestions?
I had to install from source:
pip install -U -q git+https://github.com/huggingface/transformers.git
pip install -U -q git+https://github.com/huggingface/pytorch-image-models.git
Hi @totoro74 ,
Welcome to Google Gemma family of open source models, Could you please provide us with the versions of your transformers
, timm
and pytorch
to better assist you further. Thank you so much for you continues interest in Gemma models and your patience is highly appreciated.
It's highly recommend to use the latest version of libraries/packages with the latest versions of model to avoid version compatibility related issues.
Thanks.
Hi @BalakrishnaCh ,
I have the same issue..I tried all above sugeestions (installing from source, timm 1.0.16)
🔍 COMPLETE ENVIRONMENT DIAGNOSIS
🐍 Python version: 2.6.0+cu124
🔥 PyTorch version: 2.6.0+cu124
🤗 Transformers version: 4.54.0.dev0
📸 Timm version: 1.0.15
⚡ CUDA version: 12.4
💻 GPU: Tesla T4
🔍 EXHAUSTIVE MODEL SEARCH:
📊 Total models in timm: 1200
📱 MobileNet models: 40
🔢 V5 models: 0
🔐 Encoder models: 3
📋 MobileNet examples: ['mobilenet_edgetpu_100', 'mobilenet_edgetpu_v2_l', 'mobilenet_edgetpu_v2_m', 'mobilenet_edgetpu_v2_s', 'mobilenet_edgetpu_v2_xs']
📋 Encoder examples: ['sequencer2d_l', 'sequencer2d_m', 'sequencer2d_s']
📏 300M models: ['vit_intern300m_patch14_448']
🎯 DIRECT SEARCH FOR TARGET:
❌ NOT FOUND: mobilenetv5_300m_enc
🔍 Checking variations:
❌ Missing: mobilenetv5_300m_enc
❌ Missing: mobilenet_v5_300m_enc
❌ Missing: mobilenetv5-300m-enc
❌ Missing: mobilenet-v5-300m-enc
❌ Missing: mobilenetv5_300m
❌ Missing: mobilenet_v5_300m
🤖 GEMMA 3N CONFIG ANALYSIS:
🎯 Required architecture: mobilenetv5_300m_enc
📊 Vision config keys: ['add_cross_attention', 'architecture', 'architectures', 'attribute_map', 'bad_words_ids', 'base_config_key', 'base_model_pp_plan', 'base_model_tp_plan', 'begin_suppress_tokens', 'bos_token_id', 'chunk_size_feed_forward', 'cross_attention_hidden_size', 'decoder_start_token_id', 'dict_torch_dtype_to_str', 'diversity_penalty', 'do_pooling', 'do_sample', 'early_stopping', 'encoder_no_repeat_ngram_size', 'eos_token_id', 'exponential_decay_length_penalty', 'finetuning_task', 'forced_bos_token_id', 'forced_eos_token_id', 'from_dict', 'from_json_file', 'from_pretrained', 'get_config_dict', 'get_text_config', 'has_no_defaults_at_init', 'hidden_size', 'id2label', 'initializer_range', 'is_decoder', 'is_encoder_decoder', 'label2id', 'label_names', 'length_penalty', 'max_length', 'min_length', 'model_args', 'model_type', 'name_or_path', 'no_repeat_ngram_size', 'num_beam_groups', 'num_beams', 'num_classes', 'num_labels', 'num_return_sequences', 'output_attentions', 'output_hidden_states', 'output_scores', 'pad_token_id', 'prefix', 'problem_type', 'pruned_heads', 'push_to_hub', 'register_for_auto_class', 'remove_invalid_values', 'repetition_penalty', 'return_dict', 'return_dict_in_generate', 'rms_norm_eps', 'save_pretrained', 'sep_token_id', 'sub_configs', 'suppress_tokens', 'task_specific_params', 'temperature', 'tf_legacy_loss', 'tie_encoder_decoder', 'tie_word_embeddings', 'to_dict', 'to_diff_dict', 'to_json_file', 'to_json_string', 'tokenizer_class', 'top_k', 'top_p', 'torch_dtype', 'torchscript', 'transformers_version', 'typical_p', 'update', 'update_from_string', 'use_bfloat16', 'use_return_dict', 'vocab_offset', 'vocab_size']
🔄 POTENTIAL SUBSTITUTIONS:
📋 Similar models: []
🛠️ MANUAL MODEL CREATION ATTEMPT:
✅ Manually registered mobilenetv5_300m_enc
❌ Manual creation failed: timm.models.mobilenetv3._gen_mobilenet_v3() got multiple values for keyword argument 'num_classes'
🚨 FINAL RECOMMENDATION:
- The mobilenetv5_300m_enc model doesn't exist in any public timm version
- This is likely a Google-internal model not yet released
- Contact Kaggle/Google competition support immediately
- Ask for:
- Correct timm version/source
- Alternative Gemma 3n model
- Pre-configured environment
- This is NOT a user error - it's a dependency issue
📊 ENVIRONMENT SUMMARY:
PyTorch: 2.6.0+cu124
Transformers: 4.54.0.dev0
Timm: 1.0.15
Target model: mobilenetv5_300m_enc ❌
Status: MISSING DEPENDENCY
Hi @nmo-genio and @totoro74 ,
I have reproduced the issue in my local and escalated it to the internal team for the further updates. Thank you so much for your continuous interest and your patience is really appreciated.
Thanks.
Hi @totoro74 ,
RuntimeError: Unknown model (mobilenetv5_300m_enc)
is an error from timm; it means they are not up to date. Gemma 3n requires at least timm v1.0.16. Please upgrade the timm
to latest version or at least to v1.0.16
to avoid the above issue, and also please upgrade the transformer
to the latest version to work with Gemma 3n models. I have successfully able to load the model after upgrading the timm
to v1.0.16
.
Thanks.
Is there any notebook which does this part alone. I'm still facing same error guys. Because I'm facing some issues in installing timm v1.0.16
Notebook I'm using: https://www.kaggle.com/code/hasandon007/gemma-3n-transformer/notebook
Hi @R-Mohammed-Hasan ,
I have inspected your Kaggle notebook, in that your timm
is still pointing to the older version only ('1.0.15'
). Please restart your notebook runtime session to reflect the latest installation changes. Please find the attached gist file for your reference.
Thanks.