Skip to content

Deprecated Warning of torchvision "pretrained" #223

@lcycode

Description

@lcycode

新的torchvision0.14在加载模型的时候已经弃用了pretrained, 而是使用weights, 当我在加载resnet50的时候出现的如下的警告。

> model = pretrainedmodels.__dict__["resnet50"]()

...\torchvision\models\_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
  warnings.warn(
...\torchvision\models\_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=None`.
  warnings.warn(msg)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions