Shortcuts

list_models

torchvision.models.list_models(module: Optional[module] = None, include: Optional[Union[Iterable[str], str]] = None, exclude: Optional[Union[Iterable[str], str]] = None) List[str][source]

返回一个包含已注册模型名称的列表。

Parameters:
  • 模块 (ModuleType, 可选) – 我们想要从中提取可用模型的模块。

  • include (strIterable[str], 可选) – 用于从所有模型集合中筛选包含的模型的过滤器。 过滤器传递给 fnmatch 以匹配 Unix shell 风格的通配符。如果有多个过滤器,结果是各个过滤器的并集。

  • exclude (strIterable[str], 可选) – 在include_filters之后应用的过滤器,用于移除模型。 过滤器传递给fnmatch以匹配Unix shell风格的通配符。如果有多个过滤器,结果是移除所有匹配任何单个过滤器的模型。

Returns:

可用模型名称的列表。

Return type:

模型 (list)