出错的原因是torchvision与pytorch的版本不对应,应该去https://download.pytorch.org/whl/torch_stable.html下载对应的版本即可。 我用的版本: