搞定系列 :paddleocr训练自己数据集windows版

FL1623863129 2023-01-13 00:07:34

课程名称适应人群
搞定系列 :paddleocr训练自己数据集windows版学生,入门者,ocr感兴趣的学者和研究人员

paddleocr训练自己数据集windows版是一门专门适合初学者训练自己的paddleocr模型教程。通过本教程您可以收获:

(1)学会在windows上安装自己的显卡驱动

(2)学会在windows上安装cuda+cudnn

(3)学会在windows上安装anaconda3

(4)学会在windows安装PPOCRLabel以及使用PPOCRLabel标注自己的数据集

(5)学会使用paddleocr训练文本检测模型

(6)学会使用paddleocr训练文本识别模型

(7)学会使用paddleocr导出自己的模型

(8)学会使用paddleocr测试自己的模型

...全文
6194 84 打赏 收藏 转发到动态 举报
写回复
用AI写文章
84 条回复
切换为时间正序
请发表友善的回复…
发表回复
幻灰龙 2023-02-21
精选
  • 打赏
  • 举报
回复
5.00元
2

支持paddlepaddle课程!

共享一片蓝天 2024-01-18
  • 打赏
  • 举报
回复

老师你好,我将训练的识别模型导出时,报错了,请问这是什么情况

img

FL1623863129 2024-01-19
  • 举报
回复
@共享一片蓝天 根据提示74行代码input_shape那句,你用Pycharm运行下个断点,怀疑是input_shape是None,进而怀疑是读取config文件没有这个参数导致None,猜测很可能config文件弄错了或者里面一些参数不对
Huimilia 2023-10-12
  • 打赏
  • 举报
回复

eval model:: 0%| | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
File "tools/train.py", line 227, in
main(config, device, logger, vdl_writer)
File "tools/train.py", line 198, in main
program.train(config, train_dataloader, valid_dataloader, device, model,
File "D:\paddle_ocr\PaddleOCR-release-2.7\tools\program.py", line 392, in train
cur_metric = eval(
File "D:\paddle_ocr\PaddleOCR-release-2.7\tools\program.py", line 581, in eval
metric['fps'] = total_frame / total_time
ZeroDivisionError: float division by zero
博主,你好,这个问题有办法解决吗?

FL1623863129 2023-10-12
  • 举报
回复
@Huimilia 好像是数据集有问题,你可以定位到那行代码,把total rime那个随便改改
Huimilia 2023-10-12
  • 举报
回复
@FL1623863129 改成固定值吗?
FL1623863129 2023-10-12
  • 举报
回复
@Huimilia 嗯,比如2
Huimilia 2023-10-08
  • 打赏
  • 举报
回复 3

(paddle) C:\Users\Administrator\PaddleOCR-release-2.7\PPOCRLabel>python PPOCRLabel.py --lang ch
[2023/10/08 14:53:10] ppocr WARNING: When args.layout is false, args.ocr is automatically set to false
Traceback (most recent call last):
File "PPOCRLabel.py", line 2842, in
sys.exit(main())
File "PPOCRLabel.py", line 2830, in main
app, _win = get_main_app(sys.argv)
File "PPOCRLabel.py", line 2820, in get_main_app
win = MainWindow(lang=args.lang,
File "PPOCRLabel.py", line 114, in init
result = self.table_ocr('./data/paddle.png', return_ocr_result_in_table=True)
File "d:\py\Anaconda3\envs\paddle\lib\site-packages\paddleocr\paddleocr.py", line 759, in call
res, _ = super().call(
File "C:\Users\Administrator\PaddleOCR-release-2.7\PPOCRLabel..\ppstructure\predict_system.py", line 129, in call res, table_time_dict = self.table_system(
File "C:\Users\Administrator\PaddleOCR-release-2.7\PPOCRLabel..\ppstructure\table\predict_table.py", line 86, in call
structure_res, elapse = self._structure(copy.deepcopy(img))
File "C:\Users\Administrator\PaddleOCR-release-2.7\PPOCRLabel..\ppstructure\table\predict_table.py", line 109, in structure
structure_res, elapse = self.table_structurer(copy.deepcopy(img))
File "C:\Users\Administrator\PaddleOCR-release-2.7\PPOCRLabel..\ppstructure\table\predict_structure.py", line 120, in call
data = transform(data, self.preprocess_op)
File "C:\Users\Administrator\PaddleOCR-release-2.7\PPOCRLabel..\ppocr\data\imaug_init
.py", line 56, in transform
data = op(data)
File "C:\Users\Administrator\PaddleOCR-release-2.7\PPOCRLabel..\ppocr\data\imaug\operators.py", line 94, in call
img.astype('float32') * self.scale - self.mean) / self.std
ValueError: operands could not be broadcast together with shapes (213,488,4) (1,1,3)在执行PPOCRLabel>python PPOCRLabel.py --lang ch出现,请问如何解决

FL1623863129 2023-10-08
  • 举报
回复
@Huimilia 先用脚本测试看看能不能预测图片,如果不行可能环境没装好
Huimilia 2023-10-08
  • 举报
回复 1
@FL1623863129 可以预测图片,只是会弹出OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.
Huimilia 2023-10-08
  • 举报
回复 1
@FL1623863129 (paddle) C:\Users\Administrator\PaddleOCR-release-2.7&gt;python tools/infer/predict_system.py --image_dir="./doc/imgs_words/ch/word_4.jpg" --det_model_dir="./weights/ch_PP-OCRv3_det_infer/" --rec_model_dir="./weights/ch_PP-OCRv3_rec_infer" OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/. (paddle) C:\Users\Administrator\PaddleOCR-release-2.7&gt;set KMP_DUPLICATE_LIB_OK=TRUE (paddle) C:\Users\Administrator\PaddleOCR-release-2.7&gt;python tools/infer/predict_system.py --image_dir="./doc/imgs_words/ch/word_4.jpg" --det_model_dir="./weights/ch_PP-OCRv3_det_infer/" --rec_model_dir="./weights/ch_PP-OCRv3_rec_infer" [2023/10/08 15:31:24] ppocr INFO: In PP-OCRv3, rec_image_shape parameter defaults to '3, 48, 320', if you are using recognition model with PP-OCRv2 or an older version, please set --rec_image_shape='3,32,320 [2023/10/08 15:31:26] ppocr DEBUG: dt_boxes num : 0, elapsed : 1.7749972343444824 [2023/10/08 15:31:26] ppocr DEBUG: rec_res num : 0, elapsed : 0.0 [2023/10/08 15:31:26] ppocr DEBUG: 0 Predict time of ./doc/imgs_words/ch/word_4.jpg: 1.776s [2023/10/08 15:31:26] ppocr DEBUG: The visualized image saved in ./inference_results\word_4.jpg [2023/10/08 15:31:26] ppocr INFO: The predict total time is 1.7849969863891602
3条回复
spaceyop 2023-08-16
  • 打赏
  • 举报
回复

你好,请问在windows下训练的模型在linux下能使用吗

FL1623863129 2023-08-16
  • 举报
回复
@spaceyop 可以的
spaceyop 2023-08-16
  • 打赏
  • 举报
回复

你好,请问在windows下训练的模型在linux下能使用吗

FL1623863129 2023-08-16
  • 举报
回复
@spaceyop 可以,一般导出推理模型用
weixin_52689727 2023-07-14
  • 打赏
  • 举报
回复

用命令python tools/infer/predict_det.py --image_dir="./doc/imgs/00059985.jpg" --det_model_dir="./zhuzhuzhu/ch_PP-OCRv3_det_infer/"检测图片上的文字时提示nomodule named polygon,试了pip install polygon/pip install polygon3等都不行。该怎么解决?

img

weixin_52689727 2023-07-14
  • 举报
回复
@weixin_52689727 老师回复太慢了
FL1623863129 2023-07-14
  • 举报
回复
@weixin_52689727 安装polygon3需要电脑提前安装vs编译器,你安装一个vs2019
weixin_52689727 2023-07-14
  • 举报
回复
@FL1623863129 visual studio 2019需要勾选哪些?安装了还是提示no module named polygon,要崩溃了
2条回复
weixin_52689727 2023-07-14
  • 打赏
  • 举报
回复

(1)集成显卡,采用CPU方式Windows安装,python3.9,anaconda环境成功,在anaconda环境中安装paddlepaddle也一切顺利。
(2)验证是否装好,python下输入import paddle 和 paddle.fluid.install_check.run_check(),提示AttributeError: module 'paddle.fluid' has no attribute 'install_check',是什么原因,没安装

img

weixin_52689727 2023-07-14
  • 举报
回复
@weixin_52689727 提示没有相应的paddlepaddle版本,怎么办?
FL1623863129 2023-07-14
  • 举报
回复
@weixin_52689727 换成python3.8或者3.9
weixin_52689727 2023-07-14
  • 举报
回复
@FL1623863129 非常正确,换成了python3.9,安装成功。感谢!
weixin_52689727 2023-07-14
  • 打赏
  • 举报
回复

独立显卡怎么办?

img

weixin_52689727 2023-07-14
  • 举报
回复
@weixin_52689727 不是Nvidia的,是Intel iris Xe Graphics,怎么部署环境?
FL1623863129 2023-07-14
  • 举报
回复
@weixin_52689727 只能安装cpu版本,不过训练会很慢,视频教程是以安装gpu进行,安装cpu只需要把paddlepaddle-gpu改成paddlepaddle安装
weixin_52689727 2023-07-14
  • 举报
回复
@FL1623863129 好的,谢谢回复
spaceyop 2023-07-04
  • 打赏
  • 举报
回复

你好,我在做模型推理的时候,执行命令后,推理出来的图片没有文本框,即使有文本框,但文本框很大(文本框里有多个关键字信息),不是一个文本框对应一个关键字信息

FL1623863129 2023-07-04
  • 举报
回复
@spaceyop 多少数据集训练的,一般没训练好
spaceyop 2023-07-04
  • 举报
回复
@FL1623863129 我就拿paddleocr的doc下imgs中的一张图片去推理的,就是此视屏中那张图片,我只是做了个预测推理,没有数据集
FL1623863129 2023-07-04
  • 举报
回复
@spaceyop 可能那个配置文件yml没对好吧
2条回复
一生有你吧 2023-06-10
  • 打赏
  • 举报
回复

卢老师,训练pp v3ocr 时候 训练一会就卡住

一生有你吧 2023-06-04
  • 打赏
  • 举报
回复

这个识别训练 不用加入预识别模型吗

FL1623863129 2023-06-04
  • 举报
回复
@一生有你吧 可以加,也可以不加,一般加会加速训练,配置文件里面有个参数,默认应该有链接,会自动下载
一生有你吧 2023-06-07
  • 举报
回复
@FL1623863129 rec模型训练了 但是没识别出来 不知道错哪里了
FL1623863129 2023-06-07
  • 举报
回复
@一生有你吧 rec模型训练完成检测难很多,识别需要大量数据集才行,不然识别效果差,最好能超过1w张,越多越好
2条回复
一生有你吧 2023-03-02
  • 打赏
  • 举报
回复

Traceback (most recent call last):
File "tools/infer/predict_det.py", line 252, in
dt_boxes, _ = text_detector(img)
File "tools/infer/predict_det.py", line 216, in call
post_result = self.postprocess_op(preds, shape_list)
File "E:\paddleocr2.2\PaddleOCR-release-2.2\ppocr\postprocess\db_postprocess.py", line 185, in call
boxes, scores = self.boxes_from_bitmap(pred[batch_index], mask,
File "E:\paddleocr2.2\PaddleOCR-release-2.2\ppocr\postprocess\db_postprocess.py", line 79, in boxes_from_bitmap
score = self.box_score_fast(pred, points.reshape(-1, 2))
File "E:\paddleocr2.2\PaddleOCR-release-2.2\ppocr\postprocess\db_postprocess.py", line 137, in box_score_fast
xmin = np.clip(np.floor(box[:, 0].min()).astype(np.int), 0, w - 1)
File "D:\anzhuang\AI\Anaconda3\envs\paddle\lib\site-packages\numpy_init_.py", line 305, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'int'.
np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.
老师这个什么原因你 有没有QQ交流群 好询问问题呀

FL1623863129 2023-03-02
  • 举报
回复
@一生有你吧 numpy版本看起来不对
一生有你吧 2023-03-02
  • 打赏
  • 举报
回复

老师能不能分享下 C++调用 最新版的ocr

神秘男网友 2023-02-20
  • 打赏
  • 举报
回复

那四个txt文件怎么来的没有交代清楚啊,听的一头雾水,卡在这一步了

FL1623863129 2023-02-21
  • 举报
回复
@神秘男网友 txt是ppocrlabel标注生成的
神秘男网友 2023-02-21
  • 举报
回复
@FL1623863129 我知道是标注生成啊,但是你拷贝了之后,txt里面的路径肯定变了啊,还有我用cpu训练报错这个,按照教程改的参数,OSError: Invalid enum backend type `64`. [..\paddle/phi/common/backend.h:140]搞了两天了还没解决呢
FL1623863129 2023-02-21
  • 举报
回复
@神秘男网友 txt拷贝后路径不会变,因为ppocrlabel生成是相对路径
1条回复
qq_17124259 2022-07-27
  • 打赏
  • 举报
回复
您好,老师,验证模型精度很好,转成.nb精度很差。
FL1623863129 2022-07-27
  • 举报
回复
@qq_17124259 <p>您好这个课程主要是讲解如何搭建环境和训练,这个部署我也不是很熟呢,去github issue问问</p>
qq_17124259 2022-07-15
  • 打赏
  • 举报
回复
RecursionError: maximum recursion depth exceeded while calling a Python object 检测训练有错误
FL1623863129 2022-07-15
  • 举报
回复
@qq_17124259 <p>这个应该数据集配置有问题,比如图片路径不对,要是图片所在目录。</p>
qq_17124259 2022-07-15
  • 打赏
  • 举报
回复
你好,老师,det_train.txt和de_test.txt这两个文件的内容都是一样的吗。
FL1623863129 2022-07-15
  • 举报
回复
@qq_17124259 <p>一般不一样,但是有时候数据集少的话可以弄成一样。</p>
qq_17124259 2022-07-15
  • 打赏
  • 举报
回复
你好,老师,det_train.txt和de_test.txt这两个文件的内容都是一样的吗。
FL1623863129 2022-07-15
  • 举报
回复
@qq_17124259 <p>不是一样的,也可以一样,那样训练集也是验证集,一般不建议弄成一样。如果数据集少想要都参与训练可以弄成一样。</p>
加载更多回复(12)

47

社区成员

发帖
与我相关
我的任务
社区描述
计算机应用软件开发,长期致力于研究图像算法,人工智能算法,边缘部署,算法落地研究
计算机视觉opencv目标检测 个人社区 浙江省·杭州市
社区管理员
  • FL1623863129
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧