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] [源代码]¶
返回一个包含已注册模型名称的列表。
- 参数:
module (ModuleType, optional) – 我们想要从中提取可用模型的模块。
include (str 或 Iterable[str], optional) – 用于从所有模型集中包含模型的过滤器。过滤器会传递给 fnmatch 以匹配 Unix shell 风格的通配符。如果存在多个过滤器,结果将是单个过滤器的并集。
exclude (str 或 Iterable[str], optional) – 在 include_filters 之后应用的过滤器,用于移除模型。过滤器会传递给 fnmatch 以匹配 Unix shell 风格的通配符。如果存在多个过滤器,结果将是移除所有匹配任何单个过滤器的模型。
- 返回:
一个包含可用模型名称的列表。
- 返回类型:
models (list)