question
When reproducing Microsoft's open source REID model - "Attention_Networks/Relation-Aware-Global-Attention-Networks", ImportError: cannot import name 'imsave'
an error occurred when running the program, as follows
Traceback (most recent call last):
File "main_imgreid.py", line 19, in <module>
from reid import data_manager
File "/home/REID/Attention_Networks/Relation-Aware-Global-Attention-Networks-master/reid/data_manager/__init__.py", line 5, in <module>
from .cuhk03 import CUHK03
File "/home/REID/Attention_Networks/Relation-Aware-Global-Attention-Networks-master/reid/data_manager/cuhk03.py", line 16, in <module>
from scipy.misc import imsave
ImportError: cannot import name 'imsave'
solve
in cuhk03.py
_
- will be
from scipy.misc import imsave
replaced withimport imageio
- will be
imsave(img_path, img)
replaced withimageio.imwrite(img_path, img)
analyze
The new version of the scipy library does not have the imsave method. If you want to continue using the original code, you need to install the old version of scipy.
Reference: https://blog.csdn.net/Rex_WUST/article/details/86250165