PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
41.29k stars 7.56k forks source link

CUDA 11.6 + CUDNN 8.4 运行OCR 返回的Result为None,另外一台纯CPU模式同一张图是可以的 #11289

Open shaoerkuai opened 8 months ago

shaoerkuai commented 8 months ago

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

ocr = PaddleOCR(use_angle_cls=True, lang="ch") # need to run only once to download and load model into memory img_path = "D:\img\20231122140525.jpg" t1 = time.time() print("21321") result = ocr.ocr(img_path, det=True, cls=True) # 这里Result就是None了 for idx in range(len(result)): res = result[idx] for line in res:
print(line)

我们提供了AceIssueSolver来帮助你解答问题,你是否想要它来解答(请填写yes/no)?/We provide AceIssueSolver to solve issues, do you want it? (Please write yes/no):

no

请尽量不要包含图片在问题中/Please try to not include the image in the issue.

shaoerkuai commented 8 months ago

当前版本: paddleocr 2.7.0.3 paddlepaddle-gpu 2.5.2.post116 cudnn 8.4.0.27_cuda11.6 cuda_11.6.1_511.65 驱动支持的CUDA 11.6.127 设置gpu = false 也是可以正常识别的,开启GPU后就不支持。

shaoerkuai commented 8 months ago

试下paddle 的检查: The GPU architecture in your current machine is Maxwell, which is not compatible with Paddle installation with arch: 70 75 80 86 , it is recommended to install the corresponding wheel package according to the installation information on the official Paddle website.

应该是Maxwell架构不支持,更换了老版本后,出现如下情况: [[[984.0, 738.0], [1006.0, 738.0], [1006.0, 752.0], [984.0, 752.0]], ('茂团瞬潜阅予彭任~授仲z充鸟驱俗J’潜俗劣士号画 乡傻翼√机谁筋′灭驾j妥剩_腰显', 0.997814953327179)] [[[1132.0, 736.0], [1154.0, 736.0], [1154.0, 752.0], [1132.0, 752.0]], ('乱丫傅丫管富管丫字富管叫喘l锦胃丫μ胃隐', 0 .803952693939209)] [[[1234.0, 736.0], [1274.0, 736.0], [1274.0, 750.0], [1234.0, 750.0]], ('婚亏丑痧授充妇东於团逾仁钜搁佛圳>遵劵滚旅坠 識.皆?临話蜂错仁圣措充μ遒丶应租', 0.9999554753303528)] [[[1866.0, 738.0], [1876.0, 738.0], [1876.0, 750.0], [1866.0, 750.0]], ("衍j—奢录承剩吉满陆w吉呈‘谁仁磊号仁归响歡滚 虽允喷越贷幽'惟贷遵眼损展°团饿", 0.9942718148231506)] [[[1877.0, 733.0], [1879.0, 753.0], [1888.0, 744.0], [1879.0, 753.0]], ('诺丫傅丫管富管丫字富管叫喘l锦胃丫μ胃隐', 0 .8039463758468628)] [[[32.0, 761.0], [32.0, 781.0], [42.0, 771.0], [32.0, 781.0]], ('方含洗埔²净才晟冶何什豫²介何爷丫胖丫什丫董丫币爷還■ 繁', 0.8569181561470032)] [[[40.0, 763.0], [74.0, 763.0], [74.0, 777.0], [40.0, 777.0]], ('茂团瞬潜阅予彭任~授仲z充鸟驱俗J’潜俗劣士号画乡傻翼 √机谁筋′灭驾j妥剩_腰显', 0.997814953327179)] [[[44.0, 757.0], [54.0, 748.0], [64.0, 757.0], [54.0, 767.0]], ('婚亏丑痧授充妇东於团逾仁钜搁佛圳>遵劵滚旅坠識.皆?临 話蜂错仁圣措充μ遒丶应租', 0.9999554753303528)]

全是乱识别的乱码...

shaoerkuai commented 8 months ago

解决方案: GTX 9系列使用以下CUDA版本正常,希望能够解决,当前可以通过降低CUDA版本解决,不过后续升级WIN11,CUDA 10.2就用不了了。当前WIN10还能正常使用。 驱动不需要降级,只需要卸载重新安装对应版本的CUDA即可。 CUDA v10.2 CUDNN v7.6.5.32