You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
model = ONNXPaddleOcr(det_limit_side_len=det_limit_side_len, det_model_dir=det_model_dir, rec_model_dir=rec_model_dir, rec_char_dict_path=rec_char_dict_path, cls_model_dir=cls_model_dir, use_angle_cls=True, use_gpu=False, use_onnx=True)
imgpath = ''
img = cv2.imread('./onnxocr/test_images/ru.png')
s = time.time()
result = model.ocr(img)
e = time.time()
print("total time: {:.3f}".format(e - s))
print("result:", result)
for box in result[0]:
print(box)
sav2Img(img, result)
运行时出现下列错误:
outputs = self.det_onnx_session.run(self.det_output_name, input_feed=input_feed)
File "/home/xxxx/anaconda3paddle/envs/paddle2onnx/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 200, in run
return self._sess.run(output_names, input_feed, run_options)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Got invalid dimensions for input: x for the following indices
index: 3 Got: 832 Expected: 960
Please fix either the inputs or the model.
请问一下这是什么原因?
The text was updated successfully, but these errors were encountered:
非常棒的工作。使用多语言检测模型onnx时出现了下面的情况
1、运行环境
numpy 1.26.4
onnxruntime 1.14.1
onnxruntime-gpu 1.14.1
opencv-contrib-python 4.7.0.72
opencv-python 4.11.0.86
opencv-python-headless 4.7.0.72
opt-einsum 3.3.0
packaging 24.2
paddle2onnx 1.2.4
paddlepaddle 2.6.0
2、使用多语言检测模型Multilingual_PP-OCRv3_det_infer出现错误
import cv2
import time
from onnxocr.onnx_paddleocr import ONNXPaddleOcr,sav2Img
import sys
det_model_dir = '/data/app/paddlepaddle/Multilingual_PP-OCRv3_det_infer.onnx'
rec_model_dir = '/data/app/paddlepaddle/cyrillic_PP-OCRv3_rec_infer.onnx'
rec_char_dict_path = '/data/app/paddlepaddle/OnnxOCR-main/onnxocr/dict/cyrillic_dict.txt'
cls_model_dir = '/data/app/paddlepaddle/ch_ppocr_mobile_v2.0_cls_infer.onnx'
det_limit_side_len = 960
model = ONNXPaddleOcr(det_limit_side_len=det_limit_side_len, det_model_dir=det_model_dir, rec_model_dir=rec_model_dir, rec_char_dict_path=rec_char_dict_path, cls_model_dir=cls_model_dir, use_angle_cls=True, use_gpu=False, use_onnx=True)
imgpath = ''
img = cv2.imread('./onnxocr/test_images/ru.png')
s = time.time()
result = model.ocr(img)
e = time.time()
print("total time: {:.3f}".format(e - s))
print("result:", result)
for box in result[0]:
print(box)
sav2Img(img, result)
运行时出现下列错误:
outputs = self.det_onnx_session.run(self.det_output_name, input_feed=input_feed)
File "/home/xxxx/anaconda3paddle/envs/paddle2onnx/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 200, in run
return self._sess.run(output_names, input_feed, run_options)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Got invalid dimensions for input: x for the following indices
index: 3 Got: 832 Expected: 960
Please fix either the inputs or the model.
请问一下这是什么原因?
The text was updated successfully, but these errors were encountered: