mseitzer / pytorch-fid

Compute FID scores with PyTorch.
Apache License 2.0
3.22k stars 497 forks source link

Replace deprecated function parameters in torchvision API for Inception model #88

Closed JannikWolff closed 1 year ago

JannikWolff commented 1 year ago

PyTorch changed the model zoo API, see https://pytorch.org/vision/main/models/generated/torchvision.models.inception_v3.html

The following equivalences hold:

pretrained=False -> weights=None
pretrained=True -> weights='DEFAULT'

The old code produces the following warnings

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)
mseitzer commented 1 year ago

Thanks for the PR! Merged.