breezedeus / CnOCR

CnOCR: Awesome Chinese/English OCR Python toolkits based on PyTorch. It comes with 20+ well-trained models for different application scenarios and can be used directly after installation. 【基于 PyTorch/MXNet 的中文/英文 OCR Python 包。】
https://www.breezedeus.com/article/cnocr
Apache License 2.0
3.19k stars 498 forks source link

无法使用已有的模块 #331

Open 12dc32d opened 3 months ago

12dc32d commented 3 months ago

报错:from cnocr.trainer import OcrTrainer里的OcrTrainer Cannot find reference 'OcrTrainer' in 'trainer.py'

但是我在查询模块的时候,是具备这个trainer的: (.venv) PS D:\Python_model\vcodeocr> dir D:\Python_model\vcodeocr.venv\Lib\site-packages\cnocr

目录: D:\Python_model\vcodeocr\.venv\Lib\site-packages\cnocr

Mode LastWriteTime Length Name


d----- 2024/6/24 17:19 classification d----- 2024/6/24 17:19 data_utils d----- 2024/6/24 17:19 models d----- 2024/6/24 17:19 ppocr d----- 2024/6/24 17:19 pycache
-a---- 2024/6/24 17:19 7024 app.py
-a---- 2024/6/24 17:19 8314 clf_cli.py -a---- 2024/6/24 17:19 20393 cli.py -a---- 2024/6/24 17:19 17853 cn_ocr.py -a---- 2024/6/24 17:19 13733 consts.py
-a---- 2024/6/24 17:19 6380 dataset.py -a---- 2024/6/24 17:19 3931 dataset_utils.py -a---- 2024/6/24 17:19 8873 gradio_app.py -a---- 2024/6/24 17:19 9676 gradio_app2.py -a---- 2024/6/24 17:19 26570 label_cn.txt -a---- 2024/6/24 17:19 19 label_number.txt -a---- 2024/6/24 17:19 4596 line_split.py
-a---- 2024/6/24 17:19 7573 lr_scheduler.py -a---- 2024/6/24 17:19 17227 recognizer.py -a---- 2024/6/24 17:19 1797 serve.py -a---- 2024/6/24 17:19 13168 trainer.py
-a---- 2024/6/24 17:19 14898 utils.py -a---- 2024/6/24 17:19 1276 init.py -a---- 2024/6/24 17:19 898 version.py

breezedeus commented 2 weeks ago

看看安装的版本吧。