List all classifier models #1343
Replies: 1 comment 1 reply
-
@hendriklohse all of the models are current classification models (different tasks like segmentation, obj detection comming). Whether the attr is named If you are looking to use all models consistenly in a different task, you can remove the classifier consistently with the reset_classifier() (or on creation with global_pool and num_classes args) as per the docs and then wrap the 'body' / 'backbone' in your own model with custom head. The name of the classifier (the final nn.Linear) is also currently available in the pretrained_cfg (transitioning away from default_cfg) for each model-weight combo. You can query those with snippet below (now api for get_pretrained_cfg) fairly new in 0.6.x. As to whether the instance is part of a
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
For a project I'm trying to evaluate different classifier model architectures, and for that it would be nice to be able to list all timm classifier models to loop over (e.g. something like
timm.list_models("*efficientnet*", pretrained=True, type=classifier)
). After multiple long dives into the code and documentation, I did not find such a feature, so I decided to ask it here. Currently I am listing all models to loop over, and check manually withhasattr(model, "classifier")
, but as this is only possible after creating the model, it seems very inefficient.Beta Was this translation helpful? Give feedback.
All reactions