[PaddlePaddle/PaddleOCR]无法打开ch_PP-OCRv3_det_infer中的inference.pdmodel

2024-05-14 230 views
0
  • 系统环境/System Environment:
  • 版本号/Version:Paddle: PaddleOCR: 问题相关组件/Related components:
  • 运行指令/Command Code:
  • 完整报错/Complete Error Message: 无法打开ch_PP-OCRv3_det_infer中的inference.pdmodel,系统环境paddle2.4,cuda1.7 paddleocr2.6rc,python3.9

回答

7

需要用visualDL打开进行可视化

3

需要用visualDL打开进行可视化

我用python直接调用模型文件不能使用

0

怎么调用的?

7

怎么调用的?

ocr = PaddleOCR(rec_model_dir='./ocr/rec/ch/ch_PP-OCRv3_rec_infer',det_model_dir='./ocr/det/ch/ch_PP-OCRv3_det_infer', cls_model_dir='./ocr/cls/ch_ppocr_mobile_v2.0_cls_infer')

读取图片

file_path = './test.png' img = cv2.imread(file_path)

0

报的啥错误?

4

报的啥错误?

就是打不开文件./ocr/det/ch/ch_PP-OCRv3_det_infer/inference.pdmodel

6

你截图下报错,是找不到文件,还是文件损坏?

7

你截图下报错,是找不到文件,还是文件损坏?

(NotFound) Cannot open file D:/mode/ch_PP-OCRv3_det_infer/inference.pdmodel, please confirm whether the file is normal. [Hint: Expected static_cast(fin.is_open()) == true, but received static_cast(fin.is_open()):0 != true:1.] (at ..\paddle\fluid\inference\api\analysis_predictor.cc:1901)

8

D:/mode/ch_PP-OCRv3_det_infer/inference.pdmodel

路径看看是不是写的有问题?

0

D:/mode/ch_PP-OCRv3_det_infer/inference.pdmodel

D:/mode/ch_PP-OCRv3_det_infer/inference.pdmodel

路径看看是不是写的有问题?

路径没问题呀

5

你不指定试试呢?默认会自动下载模型

2

你不指定试试呢?默认会自动下载模型 什么意思,指定ch_pp-ocrv3_det_infer文件夹里的模型吗

0

直接使用默认参数 ocr = PaddleOCR()

3

不指定参数出来就是这个错误Cannot open file C:\Users/.paddleocr/whl\det\ch\ch_PP-OCRv3_det_infer/inference.pdmodel, please confirm whether the file is normal. [Hint: Expected static_cast(fin.is_open()) == true, but received static_cast(fin.is_open()):0 != true:1.] (at ..\paddle\fluid\inference\api\analysis_predictor.cc:1901)

4

应该是Windows路径问题,改成反斜扛试试 D:\mode\ch_PP-OCRv3_det_infer\inference.pdmodel

2

D:\mode\ch_PP-OCRv3_det_infer\inference.pdmodel

还是不行正斜杠和反斜杠都试了还是这个错误

0

这个问题解决了么,我也是这个情况

8
  • paddleocr2.6rc重新按照官网下载paddleocr下载一次,问题应该就可以解了,
0

问题解决了吗,我也是这个问题

9

同样的问题,我是c++版本碰到的

1

C++ Traceback (most recent call last):

Not support stack backtrace yet.


Error Message Summary:

NotFoundError: Cannot open file =/inference.pdmodel, please confirm whether the file is normal. [Hint: Expected static_cast(fin.is_open()) == true, but received static_cast(fin.is_open()):0 != true:1.] (at C:\home\workspace\Paddle_release\paddle\fluid\inference\api\analysis_predictor.cc:1500)