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
42.64k stars 7.67k forks source link

跟着 applications/发票关键信息抽取.md 教程执行报错 #11696

Closed tinyxia closed 3 months ago

tinyxia commented 6 months ago

环境如下

[2024-03-08 09:55:08,197] [ INFO] - All the weights of LayoutXLMModel were initialized from the model checkpoint at vi-layoutxlm-base-uncased. If your task is similar to the task the model of the checkpoint was trained on, you can already use LayoutXLMModel for predictions without further training. Traceback (most recent call last): File "tools/train.py", line 227, in main(config, device, logger, vdl_writer) File "tools/train.py", line 135, in main model = build_model(config['Architecture']) File "/Users/zhuxiaoxia/Documents/python/PaddleOCR/ppocr/modeling/architectures/init.py", line 34, in build_model arch = getattr(mod, name)(config) File "/Users/zhuxiaoxia/Documents/python/PaddleOCR/ppocr/modeling/architectures/distillation_model.py", line 47, in init model = BaseModel(model_config) File "/Users/zhuxiaoxia/Documents/python/PaddleOCR/ppocr/modeling/architectures/base_model.py", line 55, in init self.backbone = build_backbone(config["Backbone"], model_type) File "/Users/zhuxiaoxia/Documents/python/PaddleOCR/ppocr/modeling/backbones/init.py", line 80, in build_backbone module_class = eval(module_name)(*config) File "/Users/zhuxiaoxia/Documents/python/PaddleOCR/ppocr/modeling/backbones/vqa_layoutlm.py", line 149, in init super(LayoutXLMForSer, self).init( File "/Users/zhuxiaoxia/Documents/python/PaddleOCR/ppocr/modeling/backbones/vqa_layoutlm.py", line 65, in init self.model = model_class( File "/Users/zhuxiaoxia/.pyenv/versions/3.8.12/lib/python3.8/site-packages/paddlenlp/transformers/utils.py", line 253, in impl init_func(self, args, **kwargs) TypeError: init() got an unexpected keyword argument 'num_classes' ➜ PaddleOCR git:(release/2.7) ✗

changdazhou commented 6 months ago

建议仔细检查配置文件是否有修改错误,这边复现是没有问题的哈

SwordyLee commented 6 months ago

建议仔细检查配置文件是否有修改错误,这边复现是没有问题的哈

可以提供一下您那边的配置吗,我这边也有同样的问题

changdazhou commented 6 months ago

我这边就是使用的官方配置哈