本人在使用pytorch进行vgg16特征图可视化画图时碰到了以上问题,查询解决方法时很多建议 pip install Pillow 但是我这里输入后显示已经安装,而且还是报错,显然不是这个问题。后来发现是scipy库版本较高,建议降到1.2.0版本,我输入如下指令后:
pip install scipy==1.2.0
Installing collected packages: scipy
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.
We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.
albumentations 0.4.2 requires imgaug<0.2.7,>=0.2.5, which is not installed.
imagecorruptions 1.1.0 requires scipy>=1.2.1, but you'll have scipy 1.2.0 which is incompatible.
Successfully installed scipy-1.2.0
发现1.2.0版本安装仍然报错,有部分功能无法使用,而且使用命令行安装出现了一些问题,运行python代码任然报错,于是我继续调整合适的scipy1.2.1的python3.6版本,并且使用离线下载。
离线下载需要进入其官方下载网站:https://pypi.org/project/scipy/1.2.1/#files(这是1.2.1版本),找到需要下载的文件:scipy-1.2.1-cp36-cp36m-manylinux1_x86_64.whl 下载完成后,从命令行进入存放.whl文件的位置,运行安装指令:
pip install scipy-1.2.1-cp36-cp36m-manylinux1_x86_64.whl
安装完成后,继续运行python代码,就没有报错了。