pretrained (bool) — load pretrained ImageNet-1k weights if true
pretrained_cfg (Union[str, dict, PretrainedCfg]) — pass in external pretrained_cfg for model
pretrained_cfg_overlay (dict) — replace key-values in base pretrained_cfg with these
checkpoint_path (str) — path of checkpoint to load after the model is initialized
scriptable (bool) — set layer config so that model is jit scriptable (not working for all models yet)
exportable (bool) — set layer config so that model is traceable / ONNX exportable (not fully impl/obeyed yet)
no_jit (bool) — set layer config so that model doesn’t utilize jit scripted layers (so far activations only)
Create a model
Lookup model’s entrypoint function and pass relevant args to create a new model.
**kwargs will be passed through entrypoint fn to timm.models.build_model_with_cfg()
and then the model class init(). kwargs values set to None are pruned before passing.
Keyword Args:
drop_rate (float): dropout rate for training (default: 0.0)
global_pool (str): global pool type (default: ‘avg’)
**: other kwargs are consumed by builder or model init()
filter (str) - Wildcard filter string that works with fnmatch —
module (str) - Limit model selection to a specific submodule (ie ‘vision_transformer’) —
pretrained (bool) - Include only models with valid pretrained weights if True —
exclude_filters (str or list[str]) - Wildcard filters to exclude models after including them with filter —
name_matches_cfg (bool) - Include only models w/ model_name matching default_cfg name (excludes some aliases) —
include_tags (Optional[boo]) - Include pretrained tags in model names (model.tag). If None, defaults —
set to True when pretrained=True else False (default: None)
Return list of available model names, sorted alphabetically
Example:
model_list(‘gluon_resnet’) — returns all models starting with ‘gluon_resnet’
model_list(’resnext*, ‘resnet’) — returns all models with ‘resnext’ in ‘resnet’ module