The reason for this is that the version of torchvision is too old. This InterpolationMode is a function in the new version.
The version before the error was reported:
torchvision=0.2.2
torch=1.8.2
Solution:
pip install torchvision==0.9.1
has no side effects at all. Upgrading to a higher version may uninstall your previous torch, which is more troublesome.