pythont prompts AttributeError: module'scipy.misc' has no attribute'imsave' or'imread'

I encountered the above problem when using pytorch to visualize the feature map of vgg16. When querying the solution, many suggested pip install Pillow. But after I entered it here, it shows that it has been installed and an error is reported. Obviously this is not the problem. Later, it was found that the version of the scipy library was higher. It is recommended to downgrade to version 1.2.0. After I entered the following command:

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

I found that the installation of version 1.2.0 still reported errors, some functions were unavailable, and there were some problems with the command line installation, and the running python code still reported errors, so I continued to adjust the appropriate python3.6 version of scipy1.2.1 and used offline download.

To download offline, you need to enter its official download website: https://pypi.org/project/scipy/1.2.1/#files (this is version 1.2.1), and find the file that needs to be downloaded: scipy-1.2.1-cp36- After the download of cp36m-manylinux1_x86_64.whl is complete, enter the location where the .whl file is stored from the command line, and run the installation instructions:

pip install scipy-1.2.1-cp36-cp36m-manylinux1_x86_64.whl

After the installation is complete, continue to run the python code, there is no error.

Guess you like

Origin blog.csdn.net/qq_44442727/article/details/112971606