-
I want to train mobilenetv1 with timm and I found it only provide v2 and v3. I am trying to use the model from huggingface named Matthijs/mobilenet_v1_1.0_224. However, after downloading it will report error saying the model name not exist in the factory, at this step. I am new to timm but wonder how to solve this. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
The reason is that in the provided huggingface model, the pretrained_cfg has 'architectures' instead of 'architecture' as a key, so this line can be followed by My final solution to use MobileNetV1 is to define it by myself in a local models directory, copying and modifying the module |
Beta Was this translation helpful? Give feedback.
-
Found it, but some of the fns, args might have changed...
|
Beta Was this translation helpful? Give feedback.
The reason is that in the provided huggingface model, the pretrained_cfg has 'architectures' instead of 'architecture' as a key, so this line can be followed by
if model_name is None: model_name = pretrained_cfg.get('architectures')[0]
. However, the model_name ofMobileNetV1ForImageClassification
is not defined nor registered so this line will raise an error. I do not know how to use theMobileNetV1ForImageClassification
as stated on this page. Specifically, I am not able to dofrom transformers import MobileNetV1ForImageClassification
.My final solution to use MobileNetV1 is to define it by myself in a local models directory, copying and modifying the module
EfficientNet
to a new moduleM…