‘numpy.ndarray‘ object has no attribute ‘convert‘

First convFirst convert it to image object by Image.fromarray then use convertert it to image First

AttributeError: ‘numpy.ndarray‘ object has no attribute ‘convert'

Convert it to an image object by Image.fromarray then use convert

from PIL import Image

      
grad2__ = Image.fromarray(grad2_)
-----------------------------------------
hash0   = imagehash.average_hash(grad2__) 

or 

image   = grad2__.convert("RGB")

 

你可能感兴趣的:(debug)