报错内容:
Model files already exist. Using cached files. To redownload, please delete the directory manually: `/home/fugubiao/.paddlex/official_models/SLANet_plus`.
Bucketed engine_config has no entry for resolved engine 'hpi'; using an empty config for that engine.
Automatically converting PaddlePaddle model to ONNX format
Inference backend: onnxruntime
Inference backend config: cpu_num_threads=10
...
RuntimeError: Node (Loop.0) Op (Loop) [TypeInferenceError] Graph attribute inferencing failed: Node:Loop.0 Output:p2o.pd_op.logical_and.0.0 [ShapeInferenceError] Mismatch between number of inferred and declared dimensions. inferred=1 declared=0
因为开启高性能模式enable_hpi=True 时会将模型转为onnx格式,这里的表格模型在转为onnx时候会报错。
我 的做法我在网上找已经转好onnx的模型打补丁。
中存在我需要的模型:slanet-plus.onnx
至于这个模型的名称是你指定的哪一个:
python
pipeline = PPStructureV3(
wired_table_structure_recognition_model_name="SLANet_plus")
你也可以手动复制入C:/Users/你的用户名/.paddlex/official_models/SLANet_plus
我是在docker-compose.yaml直接丢进去。
python
volumes:
- ./patches/models/SLANet_plus/inference.onnx:/root/.paddlex/official_models/SLANet_plus/inference.onnx
另外我相信有一部分人会遇到缺失hpi_model_info_collection.json的错误:
FileNotFoundError: [Errno 2] No such file or directory: '/home/fugubiao/app/anaconda3/envs/paddle310/lib/python3.10/site-packages/paddlex/inference/models/runners/hpi/hpi_model_info_collection.json'
在官方PaddleX将源码down下来,一样打补丁就好了
python
volumes:
- ./patches/runners:/usr/local/lib/python3.10/site-packages/paddlex/inference/models/runners
最后吐槽一下Paddlex 缺失这些文件真的很致命。