-
Notifications
You must be signed in to change notification settings - Fork 974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
高新能插件推理支持自己训练之后的文档图像方向分类模型吗? #2865
Comments
补充:换成使用官方的模型还是报同样的错误 推理代码: |
不可以这么使用哦,高性能推理目前只能在产线中使用 |
那么我的文档方向分类不使用高性能推理,但是通用ocr使用高性能推理之后会报错 代码: model = create_model("PP-LCNet_x1_0_doc_ori",) pipeline = create_pipeline(pipeline="./my_path/OCR.yaml", for res in output: 报错: During handling of the above exception, another exception occurred: Traceback (most recent call last): |
没太明白您的意思,可以再说的详细一些吗? |
详细说明:我将文档分类和通用ocr产线放在一个.py文件中,文档方向分类是单模型,不使用高性能推理,通用产线ocr使用高性能插件推理; 整个py文件的代码如下: cls_model = create_model("PP-LCNet_x1_0_doc_ori",) 当我运行这个py文件时,报出错误 Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
补充说明,当我把上面py文件中的文档方向分类模型的推理注释掉时,单独使用通用ocr产线的高性能推理时,推理正常; 整个py文件的代码如下: cls_model = create_model("PP-LCNet_x1_0_doc_ori",)ocr_model= create_pipeline(pipeline="./my_path/OCR.yaml", use_hpip=True, pi_params={"serial_number": "6D34-19B1-49BB-BC8B"}) cls_output = cls_model.predict("./dataset/text_image_orientation/val/img_1_1386.png")for res in ocr_output: for res in cls_outputs:print("分类")res.print()运行这个py文件推理正常进行, 问题:产线高性能推理和不使用高性能推理的单模型在一个项目中不能并存吗? |
帮忙看看我上面的问题,谢谢 |
两边都不使用高性能推理会有什么问题吗 |
序列申请的是
推理代码是
加载模型
model = create_model("./output/best_model/inference/",
use_hpip=True,
hpi_params={"1988-EEEA-43DD-A321"})
outputs = model.predict("./dataset/text_image_orientation/val/img_1_1386.png")
报错:
Traceback (most recent call last):
File "/mnt/PaddleX/test_ocr.py", line 17, in
model = create_model("./output/best_model/inference/",
File "/mnt/PaddleX/paddlex/model.py", line 29, in create_model
return _ModelBasedInference(model, *args, **kwargs)
File "/mnt/PaddleX/paddlex/model.py", line 57, in init
self._predictor = create_predictor(*args, **kwargs)
File "/mnt/PaddleX/paddlex/inference/models/init.py", line 78, in create_predictor
return _create_hp_predictor(
File "/mnt/PaddleX/paddlex/inference/models/init.py", line 50, in _create_hp_predictor
predictor = HPPredictor.get(model_name)(
File "image_classification.py", line 30, in paddlex_hpi.models.image_classification.ClasPredictor.init
File "base.py", line 165, in paddlex_hpi.models.base.HPPredictorWithDataReader.init
File "base.py", line 55, in paddlex_hpi.models.base.HPPredictor.init
File "base.py", line 114, in paddlex_hpi.models.base.HPPredictor._get_hpi_config
AttributeError: 'set' object has no attribute 'get'
The text was updated successfully, but these errors were encountered: