KIE RE 模型问题。 type is (int64_t), but the previous variable type is (float) #12410
Unanswered
wwe790673534
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
(pyocr2) D:\pythonOCR\PaddleOCR-release-2.7\ppstructure>pip list
Package Version
aiohttp 3.9.0
aiosignal 1.3.1
annotated-types 0.6.0
anyio 3.7.1
astor 0.8.1
async-timeout 4.0.3
attrdict 2.0.1
attrdict3 2.0.2
attrs 23.1.0
Babel 2.13.1
bce-python-sdk 0.8.97
beautifulsoup4 4.12.2
blinker 1.7.0
cachetools 5.3.2
certifi 2023.11.17
charset-normalizer 3.3.2
click 8.1.7
colorama 0.4.6
colorlog 6.7.0
contourpy 1.1.1
cssselect 1.2.0
cssutils 2.9.0
cycler 0.12.1
Cython 3.0.5
datasets 2.15.0
decorator 5.1.1
dill 0.3.4
easydict 1.11
et-xmlfile 1.1.0
exceptiongroup 1.1.3
faiss-cpu 1.7.1.post2
fastapi 0.104.1
filelock 3.13.1
fire 0.5.0
Flask 3.0.0
Flask-Babel 2.0.0
fonttools 4.45.0
frozenlist 1.4.0
fsspec 2023.10.0
funcsigs 1.0.2
future 0.18.3
gast 0.3.3
graphviz 0.20.1
h11 0.14.0
httpcore 1.0.1
httpx 0.25.1
huggingface-hub 0.19.4
idna 3.4
imageio 2.33.0
imgaug 0.4.0
importlib-metadata 6.8.0
importlib-resources 6.1.1
itsdangerous 2.1.2
jieba 0.42.1
Jinja2 3.1.2
joblib 1.3.2
kiwisolver 1.4.5
lazy_loader 0.3
lmdb 1.4.1
lxml 4.9.3
markdown-it-py 3.0.0
MarkupSafe 2.1.3
matplotlib 3.7.4
mdurl 0.1.2
multidict 6.0.4
multiprocess 0.70.12.2
networkx 3.1
nltk 3.8.1
numpy 1.24.4
objgraph 3.6.0
onnx 1.15.0
opencv-contrib-python 4.6.0.66
opencv-contrib-python-headless 4.2.0.32
opencv-python 4.2.0.32
opencv-python-headless 4.5.3.56
openpyxl 3.1.2
opt-einsum 3.3.0
packaging 23.2
paddle-bfloat 0.1.2
paddle2onnx 1.0.6
paddleclas 2.5.1
paddlefsl 1.1.0
paddlenlp 2.5.2
paddleocr 2.7.0.3
paddlepaddle-gpu 2.3.0rc0.post102
pandas 2.0.3
pathlib 1.0.1
pdf2docx 0.5.5
Pillow 10.1.0
pip 23.3.1
PPOCRLabel 2.1.3
premailer 3.10.0
prettytable 3.9.0
protobuf 3.20.0
psutil 5.9.6
pyarrow 14.0.1
pyarrow-hotfix 0.6
pyclipper 1.3.0.post5
pycryptodome 3.19.0
pydantic 2.5.2
pydantic_core 2.14.5
Pygments 2.17.2
PyMuPDF 1.20.2
pypandoc 1.12
pyparsing 3.1.1
PyQt5 5.15.10
PyQt5-Qt5 5.15.2
PyQt5-sip 12.13.0
python-dateutil 2.8.2
python-docx 1.1.0
pytz 2023.3.post1
PyWavelets 1.4.1
PyYAML 6.0.1
rapidfuzz 3.5.2
rarfile 4.1
regex 2023.10.3
requests 2.31.0
rich 13.7.0
safetensors 0.4.0
scikit-image 0.21.0
scikit-learn 1.3.2
scipy 1.10.1
sentencepiece 0.1.99
seqeval 1.2.2
setuptools 68.0.0
shapely 2.0.2
six 1.16.0
sniffio 1.3.0
soupsieve 2.5
starlette 0.27.0
termcolor 2.3.0
threadpoolctl 3.2.0
tifffile 2023.7.10
tqdm 4.66.1
typer 0.9.0
typing_extensions 4.8.0
tzdata 2023.3
ujson 5.8.0
urllib3 2.1.0
uvicorn 0.24.0.post1
visualdl 2.4.2
wcwidth 0.2.12
Werkzeug 3.0.1
wheel 0.41.2
xlrd 1.2.0
xxhash 3.4.1
yacs 0.1.8
yarl 1.9.3
zipp 3.17.0
python predict_system.py --kie_algorithm=LayoutXLM --re_model_dir=./inference/re_vi_layoutxlm_xfund_infer --ser_model_dir=./inference/ser_LayoutXLM_xfun_zh_infer --image_dir=./docs/kie/input/1.jpg --ser_dict_path=../ppocr/utils/dict/kie_dict/xfund_class_list.txt --use_visual_backbone=false --vis_font_path=../doc/fonts/simfang.ttf --ocr_order_method="tb-yx" --mode=kie --use_gpu=false
完整报错/Complete Error Message:
(pyocr2) D:\pythonOCR\PaddleOCR-release-2.7\ppstructure>python predict_system.py --kie_algorithm=LayoutXLM --re_model_dir=./inference/re_vi_layoutxlm_xfund_infer --ser_model_dir=./inference/ser_LayoutXLM_xfun_zh_infer --image_dir=./docs/kie/input/1.jpg --ser_dict_path=../ppocr/utils/dict/kie_dict/xfund_class_list.txt --use_visual_backbone=false --vis_font_path=../doc/fonts/simfang.ttf --ocr_order_method="tb-yx" --mode=kie --use_gpu=false
d:\anaconda3\envs\pyocr2\lib\site-packages\setuptools\sandbox.py:13: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
d:\anaconda3\envs\pyocr2\lib\site-packages\pkg_resources_init_.py:2871: DeprecationWarning: Deprecated call to
pkg_resources.declare_namespace('mpl_toolkits')
.Implementing implicit namespace packages (as specified in PEP 420) is preferred to
pkg_resources.declare_namespace
. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packagesdeclare_namespace(pkg)
d:\anaconda3\envs\pyocr2\lib\site-packages\pkg_resources_init_.py:2871: DeprecationWarning: Deprecated call to
pkg_resources.declare_namespace('google')
.Implementing implicit namespace packages (as specified in PEP 420) is preferred to
pkg_resources.declare_namespace
. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packagesdeclare_namespace(pkg)
[2023-12-27 11:47:04,531] [ INFO] - Already cached C:\Users\Administrator.paddlenlp\models\layoutxlm-base-uncased\sentencepiece.bpe.model
[2023-12-27 11:47:05,116] [ INFO] - tokenizer config file saved in C:\Users\Administrator.paddlenlp\models\layoutxlm-base-uncased\tokenizer_config.json
[2023-12-27 11:47:05,117] [ INFO] - Special tokens file saved in C:\Users\Administrator.paddlenlp\models\layoutxlm-base-uncased\special_tokens_map.json
[2023/12/27 11:47:10] ppocr INFO: [0/1] ./docs/kie/input/1.jpg
Traceback (most recent call last):
File "predict_system.py", line 315, in
main(args)
File "predict_system.py", line 254, in main
res, time_dict = structure_sys(img, img_idx=index)
File "predict_system.py", line 181, in call
re_res, elapse = self.kie_predictor(img)
File "D:\pythonOCR\PaddleOCR-release-2.7\ppstructure\kie\predict_kie_token_ser_re.py", line 64, in call
self.predictor.run()
ValueError: In user code:
File "tools/export_model.py", line 258, in
main()
File "tools/export_model.py", line 254, in main
model, arch_config, save_path, logger, input_shape=input_shape)
File "tools/export_model.py", line 174, in export_single_model
paddle.jit.save(model, save_path)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/jit.py", line 631, in wrapper
func(layer, path, input_spec, **configs)
File "", line 2, in save
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in impl
return wrapped_func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/base.py", line 51, in impl
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/jit.py", line 861, in save
inner_input_spec, with_hook=with_hook)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 528, in concrete_program_specify_input_spec
*desired_input_spec, with_hook=with_hook)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 436, in get_concrete_program
concrete_program, partial_program_layer = self._program_cache[cache_key]
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 801, in getitem
self._caches[item_id] = self._build_once(item)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 790, in _build_once
**cache_key.kwargs)
File "", line 2, in from_func_spec
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in impl
return wrapped_func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/base.py", line 51, in impl
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 733, in from_func_spec
outputs = static_func(*inputs)
File "/tmp/tmp1jzgs091.py", line 28, in forward
false_fn_1, (x,), (x,), (x,))
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 211, in convert_ifelse
out = _run_py_ifelse(pred, true_fn, false_fn, true_args, false_args)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 257, in _run_py_ifelse
return true_fn(*true_args) if pred else false_fn(*false_args)
File "/ssd1/zhoujun20/tipc/PaddleOCR/ppocr/modeling/architectures/base_model.py", line 86, in forward
x = self.backbone(x)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 930, in call
return self._dygraph_call_func(*inputs, **kwargs)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "/ssd1/zhoujun20/tipc/PaddleOCR/ppocr/modeling/backbones/vqa_layoutlm.py", line 237, in forward
relations=relations)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 930, in call
return self._dygraph_call_func(*inputs, **kwargs)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "/usr/local/lib/python3.7/site-packages/paddlenlp/transformers/layoutxlm/modeling.py", line 1542, in forward
relations)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 930, in call
return self._dygraph_call_func(*inputs, **kwargs)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 915, in _dygraph_call_func
outputs = self.forward(*inputs, **kwargs)
File "/usr/local/lib/python3.7/site-packages/paddlenlp/transformers/layoutxlm/modeling.py", line 1408, in forward
relations, entities = self.build_relation(relations, entities)
File "/tmp/tmpt8u0m8_d.py", line 106, in build_relation
for_loop_body_2, [entities, new_relations, relations, b, batch_size])
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 43, in convert_while_loop
loop_vars = _run_paddle_while_loop(cond, body, loop_vars)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 53, in _run_paddle_while_loop
loop_vars = control_flow.while_loop(cond, body, loop_vars)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/layers/control_flow.py", line 1257, in while_loop
output_vars = body(*loop_vars)
File "/tmp/tmpt8u0m8_d.py", line 86, in for_loop_body_2
jit.dy2static.convert_call(negative_mask.sum)() > 0, true_fn_36,
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py", line 347, in impl
attrs={'axis': axis})
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/framework.py", line 3621, in append_op
attrs=kwargs.get("attrs", None))
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2635, in init
for frame in traceback.extract_stack():
InvalidArgumentError: The DataType of greater_than Op's duplicable or different slot Variable Y must be consistent or reigster GetExpectedKernelType. The current variable type is (int64_t), but the previous variable type is (bool). (at ..\paddle\fluid\framework\operator.cc:1999)
[operator < greater_than > error]
问题补充:版面分析+表格识别 运行正常,SER 运行正常,SER+ER 运行失败。SER 模型用的是ser_LayoutXLM_xfun_zh_infer因为默认ser_vi_layoutxlm_xfund_infer包好像是损坏的解压后没有目录结构
Beta Was this translation helpful? Give feedback.
All reactions