AttributeError: module ‘torchvision.transforms‘ has no attribute ‘Compose‘

torchvision版本太低导致,需要更新
步骤:
Win+R 打开运行,输入cmd
AttributeError: module ‘torchvision.transforms‘ has no attribute ‘Compose‘_第1张图片
在命令窗口输入pip install --upgrade torchvision
AttributeError: module ‘torchvision.transforms‘ has no attribute ‘Compose‘_第2张图片

你可能感兴趣的:(bug排错,pytorch,python)