错误描述:
Traceback (most recent call last):
File "D:\OCR\DBNet.pytorch-master\tools\predict.py", line 195, in <module>
img = rec_image(img, boxes_max,model_cls)
File "D:\OCR\DBNet.pytorch-master\tools\predict.py", line 160, in rec_image
img = transform_test(Image.fromarray(dst_img))
AttributeError: type object 'Image' has no attribute 'fromarray'
错误的原因:
导入Image的方法错误!
错误导入: from PIL.Image import Image
正确导入: from PIL import Image