We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
训练的模型,进行识别的时候数据类型报错! 代码如下: `import ddddocr
ocr = ddddocr.DdddOcr(det=False, ocr=False, import_onnx_path="testocr_1.0_28_19000_2022-03-21-20-44-59.onnx", charsets_path="charsets.json")
with open("0CB7_1644684875.png", 'rb') as f: image = f.read()
res = ocr.classification(image) print(res)`
报错输出内容如下:
2 : INVALID_ARGUMENT : Unexpected input data type. Actual: (tensor(double)) , expected: (tensor(float))
Traceback (most recent call last): File "D:\python\ddddocr\1-验证码识别.py", line 10, in res = ocr.classification(image) File "C:\Program Files\Python39\lib\site-packages\ddddocr_init_.py", line 1629, in classification ort_outs = self.__ort_session.run(None, ort_inputs) File "C:\Users\GCB\AppData\Roaming\Python\Python39\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 195, in run return self._sess.run(output_names, input_feed, run_options) onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Unexpected input data type. Actual: (tensor(double)) , expected: (tensor(float))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
训练的模型,进行识别的时候数据类型报错!
代码如下:
`import ddddocr
ocr = ddddocr.DdddOcr()
ocr = ddddocr.DdddOcr(det=False, ocr=False, import_onnx_path="testocr_1.0_28_19000_2022-03-21-20-44-59.onnx", charsets_path="charsets.json")
with open("0CB7_1644684875.png", 'rb') as f:
image = f.read()
res = ocr.classification(image)
print(res)`
报错输出内容如下:
2 : INVALID_ARGUMENT : Unexpected input data type. Actual: (tensor(double)) , expected: (tensor(float))
Traceback (most recent call last):
File "D:\python\ddddocr\1-验证码识别.py", line 10, in
res = ocr.classification(image)
File "C:\Program Files\Python39\lib\site-packages\ddddocr_init_.py", line 1629, in classification
ort_outs = self.__ort_session.run(None, ort_inputs)
File "C:\Users\GCB\AppData\Roaming\Python\Python39\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 195, in run
return self._sess.run(output_names, input_feed, run_options)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Unexpected input data type. Actual: (tensor(double)) , expected: (tensor(float))
The text was updated successfully, but these errors were encountered: