运行pytorch时出现的错误:
module ‘torch.nn’ has no attribute ‘ModuleDict’
出现这种错误的原因是因为torchvision的版本问题,我装torchvision版本是0.4.1,而这个属性是0.2.2版本所拥有的,所以需要重新安装指定版本的torchvision。
我装的版本:
使用指令:
pip3 install torchvision==0.2.2
结果是:
运行pytorch时出现的错误:
module ‘torch.nn’ has no attribute ‘ModuleDict’
出现这种错误的原因是因为torchvision的版本问题,我装torchvision版本是0.4.1,而这个属性是0.2.2版本所拥有的,所以需要重新安装指定版本的torchvision。
我装的版本:
使用指令:
pip3 install torchvision==0.2.2
结果是: