pretrained-models.pytorch icon indicating copy to clipboard operation
pretrained-models.pytorch copied to clipboard

Deprecated Warning of torchvision "pretrained"

Open lcycode opened this issue 3 years ago • 0 comments

新的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)

lcycode avatar Nov 11 '22 12:11 lcycode