sml2h3 / ddddocr

带带弟弟 通用验证码识别OCR pypi版
https://ddddocr.com
MIT License
9.17k stars 1.67k forks source link

fix onnxruntime warning #17

Closed ashawkey closed 2 years ago

ashawkey commented 2 years ago

fix issue #7. The warning seems to be caused by the fixed output shape [1, 19] (since I don't know the actual model definitions). Changing it to dynamic axis [1, 'seqlen'] will fix the warning.

Detailed steps:

import onnx
from onnx.tools import update_model_dims
m = onnx.load('common.onnx')
m = update_model_dims.update_inputs_outputs_dims(m, {'input1': [1, 1, 64, 'image_width']}, {'output': [1, 'seqlen']})
onnx.save(m, 'common.onnx')
sml2h3 commented 2 years ago

fix issue #7. The warning seems to be caused by the fixed output shape [1, 19] (since I don't know the actual model definitions). Changing it to dynamic axis [1, 'seqlen'] will fix the warning.

Detailed steps:

import onnx
from onnx.tools import update_model_dims
m = onnx.load('common.onnx')
m = update_model_dims.update_inputs_outputs_dims(m, {'input1': [1, 1, 64, 'image_width']}, {'output': [1, 'seqlen']})
onnx.save(m, 'common.onnx')

thank! I will use this code in the next version