OCR paddle2onnx failed.
Created by: bittergourd1224
Hi, there. I'd like to transfer a PaddleOCR model to onnx, the procedure I followed is from https://github.com/PaddlePaddle/PaddleOCR/issues/213 . According to the issue, the author succeeded, but I failed during my trial.
Model:
I downloaded the PaddleOCR model from: https://paddleocr.bj.bcebos.com/ch_models/ch_det_mv3_db_infer.tar And I renamed them to__model__ and__params__, according to issue 213.
Procedure:
git clone https://github.com/PaddlePaddle/X2Paddle.git
cd X2Paddle
python setup.py install
pip install paddlepaddle
x2paddle -f paddle2onnx -m ../ch_det_mv3_db -s ./output
And the error message is:
paddle.__version__ = 1.8.4
Now, onnx2paddle support convert onnx model opset_verison [9, 10, 11],opset_verison of your onnx model is 10, automatically treated as op_set: 10.
Translating PaddlePaddle to ONNX...
Total:246, Current:1 : feed image
Total:246, Current:4 : hard_swish Traceback (most recent call last):
File "/usr/local/bin/x2paddle", line 9, in <module>
load_entry_point('x2paddle==0.8.1', 'console_scripts', 'x2paddle')()
File "/usr/local/lib/python3.5/dist-packages/x2paddle-0.8.1-py3.5.egg/x2paddle/convert.py", line 273, in main
paddle2onnx(args.model, args.save_dir, opset_version=args.onnx_opset)
File "/usr/local/lib/python3.5/dist-packages/x2paddle-0.8.1-py3.5.egg/x2paddle/convert.py", line 205, in paddle2onnx
opset_version=opset_version)
File "/usr/local/lib/python3.5/dist-packages/x2paddle-0.8.1-py3.5.egg/x2paddle/op_mapper/paddle2onnx/paddle_op_mapper.py", line 55, in convert
node = getattr(self.op_set, op.type)(op, block)
File "/usr/local/lib/python3.5/dist-packages/x2paddle-0.8.1-py3.5.egg/x2paddle/op_mapper/paddle2onnx/opset9/opset.py", line 849, in hard_swish
min_value = op.attr('min')
File "/home/xulingchuan/.local/lib/python3.5/site-packages/paddle/fluid/framework.py", line 2155, in attr
return self.desc.attr(name)
paddle.fluid.core_avx.EnforceNotMet:
--------------------------------------------
C++ Call Stacks (More useful to developers):
--------------------------------------------
0 std::string paddle::platform::GetTraceBackString<char const*>(char const*&&, char const*, int)
1 paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int)
2 paddle::framework::OpDesc::GetAttr(std::string const&) const
----------------------
Error Message Summary:
----------------------
Error: Attribute min is not found at (/paddle/paddle/fluid/framework/op_desc.cc:507)
Great appreciate if anyone could help me with this. Thanks~