Open mohdomama opened 5 years ago
I downgrade scipy to 1.1.0, but the AttributeErrors is still there.(I am setting up a new machine) Solution: install pillow
Trying out this library in 2021 and encountered the same errors, found this issue and later some solutions. I'll try to describe what I did:
Python version is 3.7.10
tensorflow-gpu version is 1.15 (replaced requirements.txt
tensorflow==1.7 with tensorflow-gpu==1.15)
ValueError: Object arrays cannot be loaded when allow_pickle=False
allow_pickle=True
e.g. detect_face.py:85, data_dict = np.load(data_path, encoding='latin1', allow_pickle=True)
AttributeError: module 'scipy.misc' has no attribute 'imread'
misc.imread
with imageio.imread
and import imageio
in all files that need itin align_dataset_mtcnn.py
I also replaced
misc.imsave
with imageio.imwrite
misc.imresize(cropped, (args.image_size, args.image_size), interp='bilinear')
with
np.asarray(Image.fromarray(cropped).resize((args.image_size, args.image_size), resample=Image.BILINEAR))
(remember to include from pillow import Image
at the top)hope that helps.
The following errors were encountered when running
src/compare.py
ValueError: Object arrays cannot be loaded when allow_pickle=False
AttributeError: module 'scipy.misc' has no attribute 'imread