> For the complete documentation index, see [llms.txt](https://boinc-ai.gitbook.io/timm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boinc-ai.gitbook.io/timm/reference/models.md).

# Models

## Models

**timm.create\_model**

[\<source>](https://github.com/huggingface/pytorch-image-models/blob/v0.9.8/timm/models/_factory.py#L38)

( model\_name: strpretrained: bool = Falsepretrained\_cfg: typing.Union\[str, typing.Dict\[str, typing.Any], timm.models.\_pretrained.PretrainedCfg, NoneType] = Nonepretrained\_cfg\_overlay: typing.Union\[typing.Dict\[str, typing.Any], NoneType] = Nonecheckpoint\_path: str = ''scriptable: typing.Optional\[bool] = Noneexportable: typing.Optional\[bool] = Noneno\_jit: typing.Optional\[bool] = None\*\*kwargs )

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): Classifier dropout rate for training. drop\_path\_rate (float): Stochastic depth drop rate for training. global\_pool (str): Classifier global pooling type.

Example:

Copied

```
>>> from timm import create_model

>>> # Create a MobileNetV3-Large model with no pretrained weights.
>>> model = create_model('mobilenetv3_large_100')

>>> # Create a MobileNetV3-Large model with pretrained weights.
>>> model = create_model('mobilenetv3_large_100', pretrained=True)
>>> model.num_classes
1000

>>> # Create a MobileNetV3-Large model with pretrained weights and a new head with 10 classes.
>>> model = create_model('mobilenetv3_large_100', pretrained=True, num_classes=10)
>>> model.num_classes
10
```

**timm.list\_models**

[\<source>](https://github.com/huggingface/pytorch-image-models/blob/v0.9.8/timm/models/_registry.py#L179)

( filter: typing.Union\[str, typing.List\[str]] = ''module: str = ''pretrained: bool = Falseexclude\_filters: typing.Union\[str, typing.List\[str]] = ''name\_matches\_cfg: bool = Falseinclude\_tags: typing.Optional\[bool] = None )

Parameters

* **filter** - Wildcard filter string that works with fnmatch —
* **module** - Limit model selection to a specific submodule (ie ‘vision\_transformer’) —
* **pretrained** - Include only models with valid pretrained weights if True —
* **exclude\_filters** - Wildcard filters to exclude models after including them with filter —
* **name\_matches\_cfg** - Include only models w/ model\_name matching default\_cfg name (excludes some aliases) —
* **include\_tags** - 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\_resne&#x74;*’) — returns all models starting with ‘gluon\_resnet’ model\_list(’*&#x72;esnext\*, ‘resnet’) — returns all models with ‘resnext’ in ‘resnet’ module
