PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

InvalidArgumentError: The 2-th dimension of input[0] and input[1] is expected to be equal.But received input[0]'s shape = [1, 512, 13, 64], input[1]'s shape = [1, 512, 1, 832]. [Hint: Expected inputs_dims[0][j] == inputs_dims[i][j], but received inputs_dims[0][j]:13 != inputs_dims[i][j]:1.] (at C:\home\workspace\Paddle_release\paddle/phi/kernels/funcs/concat_funcs.h:83)

Open LZLAlex opened this issue 1 year ago • 1 comments

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

  • 系统环境/System Environment:
  • win11
  • 版本号/Version:Paddle: PaddleOCR: 问题相关组件/Related components:
  • ch_PP-OCRv3_rec_infer
  • 运行指令/Command Code:
  • ppocr.exe system --det_model_dir=./ch_PP-OCRv3_rec_infer --rec_model_dir=./ch_PP-OCRv3_rec_infer --image_dir=test2.PNG
  • 完整报错/Complete Error Message: e[1me[35m--- Running analysis [inference_op_replace_pass]e[0m e[1me[35m--- Running analysis [memory_optimize_pass]e[0m I1120 11:52:07.862658 45768 memory_optimize_pass.cc:216] Cluster name : transpose_14.tmp_1 size: 0 I1120 11:52:07.864651 45768 memory_optimize_pass.cc:216] Cluster name : linear_43.tmp_1 size: 26500 I1120 11:52:07.864651 45768 memory_optimize_pass.cc:216] Cluster name : conv2d_113.tmp_1 size: 2048 I1120 11:52:07.864651 45768 memory_optimize_pass.cc:216] Cluster name : batch_norm_35.tmp_3 size: 6144 I1120 11:52:07.866645 45768 memory_optimize_pass.cc:216] Cluster name : x size: 576 I1120 11:52:07.867645 45768 memory_optimize_pass.cc:216] Cluster name : batch_norm_47.tmp_3 size: 6144 I1120 11:52:07.874625 45768 memory_optimize_pass.cc:216] Cluster name : transpose_13.tmp_0_slice_2 size: 480 I1120 11:52:07.879612 45768 memory_optimize_pass.cc:216] Cluster name : transpose_10.tmp_0_slice_2 size: 480 e[1me[35m--- Running analysis [ir_graph_to_program_pass]e[0m I1120 11:52:07.972364 45768 analysis_predictor.cc:1035] ======= optimize end ======= I1120 11:52:07.973362 45768 naive_executor.cc:102] --- skip [feed], feed -> x I1120 11:52:07.981340 45768 naive_executor.cc:102] --- skip [softmax_5.tmp_0], fetch -> fetch

C++ Traceback (most recent call last):

Not support stack backtrace yet.


Error Message Summary:

InvalidArgumentError: The 2-th dimension of input[0] and input[1] is expected to be equal.But received input[0]'s shape = [1, 512, 13, 64], input[1]'s shape = [1, 512, 1, 832]. [Hint: Expected inputs_dims[0][j] == inputs_dims[i][j], but received inputs_dims[0][j]:13 != inputs_dims[i][j]:1.] (at C:\home\workspace\Paddle_release\paddle/phi/kernels/funcs/concat_funcs.h:83) 我们提供了AceIssueSolver来帮助你解答问题,你是否想要它来解答(请填写yes/no)?/We provide AceIssueSolver to solve issues, do you want it? (Please write yes/no):

请尽量不要包含图片在问题中/Please try to not include the image in the issue.

LZLAlex avatar Nov 20 '23 04:11 LZLAlex

多次按照教程重装还是报这样的错误

LZLAlex avatar Nov 20 '23 06:11 LZLAlex

这个问题解决了吗?我在Mac环境下,没有这个报错,但是在Linux container中有这个报错,即使我把两边的安装包都统一了。 报错信息: app - ERROR - Exception on /invoice/invoice_recognition/kie_uie_x [POST] Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1820, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/usr/local/lib/python3.10/site-packages/flask_restx/api.py", line 404, in wrapper resp = resource(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/flask/views.py", line 107, in view return current_app.ensure_sync(self.dispatch_request)(**kwargs) File "/usr/local/lib/python3.10/site-packages/flask_restx/resource.py", line 46, in dispatch_request resp = meth(*args, **kwargs) File "/image-ocr-service/src/process/image_kie_api.py", line 177, in post finalresult = ocr_kie_xbase(save_path,invoice_type) File "/image-ocr-service/src/process/ocr_kie_uie_x_service.py", line 30, in ocr_kie_xbase result = ie({"doc":imagepath}) File "/usr/local/lib/python3.10/site-packages/paddlenlp/taskflow/taskflow.py", line 817, in call results = self.task_instance(inputs, **kwargs) File "/usr/local/lib/python3.10/site-packages/paddlenlp/taskflow/task.py", line 527, in call outputs = self._run_model(inputs, **kwargs) File "/usr/local/lib/python3.10/site-packages/paddlenlp/taskflow/information_extraction.py", line 1068, in _run_model results = self._multi_stage_predict(_inputs) File "/usr/local/lib/python3.10/site-packages/paddlenlp/taskflow/information_extraction.py", line 1166, in _multi_stage_predict result_list = self._single_stage_predict(examples) File "/usr/local/lib/python3.10/site-packages/paddlenlp/taskflow/information_extraction.py", line 979, in _single_stage_predict self.predictor.run() ValueError: (InvalidArgument) The 0-th dimension of input[0] and input[1] is expected to be equal.But received input[0]'s shape = [2, 512], input[1]'s shape = [4, 49]. [Hint: Expected inputs_dims[0][j] == inputs_dims[i][j], but received inputs_dims[0][j]:2 != inputs_dims[i][j]:4.] (at /paddle/paddle/phi/kernels/funcs/concat_funcs.h:83) [operator < concat > error]

安装包信息: Package Version


aiohttp 3.9.3 aiosignal 1.3.1 aniso8601 9.0.1 annotated-types 0.6.0 anyio 4.3.0 astor 0.8.1 async-timeout 4.0.3 attrdict 2.0.1 attrs 23.2.0 Babel 2.14.0 bce-python-sdk 0.9.4 beautifulsoup4 4.12.3 cachetools 5.3.3 certifi 2024.2.2 charset-normalizer 3.3.2 click 8.1.7 colorama 0.4.6 colorlog 6.8.2 contourpy 1.2.0 cssselect 1.2.0 cssutils 2.9.0 cycler 0.12.1 Cython 3.0.8 datasets 2.17.1 decorator 5.1.1 dill 0.3.4 et-xmlfile 1.1.0 exceptiongroup 1.2.0 fastapi 0.110.0 filelock 3.13.1 fire 0.5.0 Flask 2.2.2 flask-babel 4.0.0 flask-restx 1.2.0 fonttools 4.49.0 frozenlist 1.4.1 fsspec 2023.10.0 future 1.0.0 h11 0.14.0 httpcore 1.0.4 httpx 0.27.0 huggingface-hub 0.21.2 idna 3.6 imageio 2.34.0 imgaug 0.4.0 importlib_resources 6.1.2 itsdangerous 2.1.2 jieba 0.42.1 Jinja2 3.1.3 joblib 1.3.2 jsonschema 4.17.3 kiwisolver 1.4.5 lazy_loader 0.3 lmdb 1.4.1 lxml 5.1.0 markdown-it-py 3.0.0 MarkupSafe 2.1.5 matplotlib 3.8.3 mdurl 0.1.2 multidict 6.0.5 multiprocess 0.70.12.2 networkx 3.2.1 numpy 1.26.4 onnx 1.15.0 opencv-contrib-python 4.6.0.66 opencv-python 4.6.0.66 opencv-python-headless 4.9.0.80 openpyxl 3.1.2 opt-einsum 3.3.0 packaging 23.2 paddle2onnx 1.0.9 paddlefsl 1.1.0 paddlenlp 2.6.1 paddleocr 2.7.0.3 paddlepaddle 2.5.2 pandas 2.2.1 pdf2docx 0.5.8 pillow 10.2.0 pip 23.0.1 premailer 3.10.0 protobuf 3.20.2 psutil 5.9.8 pyarrow 15.0.0 pyarrow-hotfix 0.6 pyclipper 1.3.0.post5 pycryptodome 3.20.0 pydantic 2.6.3 pydantic_core 2.16.3 Pygments 2.17.2 PyMuPDF 1.20.0 pyparsing 3.1.1 pyrsistent 0.20.0 python-dateutil 2.8.2 python-docx 1.1.0 pytz 2024.1 PyYAML 6.0.1 rapidfuzz 3.6.1 rarfile 4.1 requests 2.31.0 rich 13.7.1 safetensors 0.4.2 scikit-image 0.22.0 scikit-learn 1.4.1.post1 scipy 1.12.0 sentencepiece 0.2.0 seqeval 1.2.2 setuptools 65.5.1 shapely 2.0.3 six 1.16.0 sniffio 1.3.1 soupsieve 2.5 starlette 0.36.3 termcolor 2.4.0 threadpoolctl 3.3.0 tifffile 2024.2.12 tqdm 4.66.2 typer 0.9.0 typing_extensions 4.10.0 tzdata 2024.1 urllib3 2.2.1 uvicorn 0.27.1 visualdl 2.5.3 Werkzeug 2.3.8 wheel 0.42.0 xxhash 3.4.1 yarl 1.9.4

huangfup avatar Mar 11 '24 01:03 huangfup

请问一下 @tink2123 这个问题怎么解决呀?

huangfup avatar Mar 12 '24 03:03 huangfup