Open xinsuinizhuan opened 4 years ago
我看您的onnx分支,识别没有做方向判断,直接是crnn_lstm模型进行识别。但是master分支里面,检测区域检测出来后,先做方向判断,然后旋转后进行识别。是onnx不需要做了吗,直接支持方向字体识别吗?
有onnx模型,可以自己转哦
另外,我尝试过,直接使用ncnn中的onnx2ncnn转crnn_lstm和crnn_lstm_lite时,提示操作不支持,但是看niuhui大神的手动修改,没看懂。是即使转换后有些模型提示不支持,然后自己手动打开parms文件,直接修改reshape等操作吗?
@xinsuinizhuan 竖排横排都是支持的,正反方向onnx还不支持
@xinsuinizhuan 竖排横排都是支持的,正反方向onnx还不支持
您这边方便转换吗?我这边尝试过转换,确实是一直提示不支持。 我这边使用ncnn的onnx2ncnn直接转换日志如下: Shape not supported yet! Gather not supported yet!
Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! ConstantOfShape not supported yet!
Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Shape not supported yet! Gather not supported yet!
Shape not supported yet! Gather not supported yet!
Shape not supported yet! Gather not supported yet!
Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unknown data type 0 Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unknown data type 0 Shape not supported yet! Gather not supported yet!
Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! ConstantOfShape not supported yet!
Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Shape not supported yet! Gather not supported yet!
Shape not supported yet! Gather not supported yet!
Shape not supported yet! Gather not supported yet!
Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unknown data type 0 Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unsupported unsqueeze axes ! Unknown data type 0
I:\NCNN\ncnn\tencent_ncnn\ncnn-master\build\tools\Release\onnx2ncnn.exe (进程 13704)已退出,代码为 0。 要在调试停止时自动关闭控制台,请启用“工具”->“选项”->“调试”->“调试停止时自动关闭控制台”。 按任意键关闭此窗口. . .
@xinsuinizhuan 先处理一下 https://github.com/daquexian/onnx-simplifier
@xinsuinizhuan 先处理一下 https://github.com/daquexian/onnx-simplifier 第一步 安装pip install onnx-simplifier 第二步: (base37) C:\WINDOWS\system32>python -m onnxsim I:\OCR\chineseocr_lite-onnx\models\crnn_lstm.onnx I:\OCR\chineseocr_lite-onnx\models\crnn_lstm_ex.onnx Simplifying... Traceback (most recent call last): File "E:\ProgramData\Anaconda3\envs\base37\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "E:\ProgramData\Anaconda3\envs\base37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "E:\ProgramData\Anaconda3\envs\base37\lib\site-packages\onnxsim__main.py", line 52, in
main() File "E:\ProgramData\Anaconda3\envs\base37\lib\site-packages\onnxsim\ main__.py", line 40, in main args.input_model, check_n=args.check_n, perform_optimization=not args.skip_optimization, skip_fuse_bn=not args.enable_fuse_bn, input_shapes=input_shapes, skipped_optimizers=args.skip_optimizer, skip_shape_inference=args.skip_shape_inference) File "E:\ProgramData\Anaconda3\envs\base37\lib\site-packages\onnxsim\onnx_simplifier.py", line 331, in simplify model, const_nodes, input_shapes=input_shapes) File "E:\ProgramData\Anaconda3\envs\base37\lib\site-packages\onnxsim\onnx_simplifier.py", line 172, in forward_for_node_outputs res = forward(model, input_shapes=input_shapes) File "E:\ProgramData\Anaconda3\envs\base37\lib\site-packages\onnxsim\onnx_simplifier.py", line 157, in forward inputs = generate_rand_input(model, input_shapes=input_shapes) File "E:\ProgramData\Anaconda3\envs\base37\lib\site-packages\onnxsim\onnx_simplifier.py", line 108, in generate_rand_input 'please determine the input size manually by --input-shape xxx'.format(key)) RuntimeError: The shape of input "input" has dynamic size, please determine the input size manually by --input-shape xxx
报错,不知道是哪儿有问题?需要加什么参数吗?
https://github.com/ouyanghuiyu/chineseocr_lite/issues/236#issuecomment-675221959 楼主,可以帮帮看一下吗?我这边要C++加载试试模型,C++进行部署测试。但是现在模型无法转换。
@xinsuinizhuan 先处理一下 https://github.com/daquexian/onnx-simplifier 第一步 安装pip install onnx-simplifier 第二步: (base37) C:\WINDOWS\system32>python -m onnxsim I:\OCR\chineseocr_lite-onnx\models\crnn_lstm.onnx I:\OCR\chineseocr_lite-onnx\models\crnn_lstm_ex.onnx Simplifying... Traceback (most recent call last): File "E:\ProgramData\Anaconda3\envs\base37\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "E:\ProgramData\Anaconda3\envs\base37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "E:\ProgramData\Anaconda3\envs\base37\lib\site-packages\onnxsimmain.py", line 52, in main() File "E:\ProgramData\Anaconda3\envs\base37\lib\site-packages\onnxsimmain.py", line 40, in main args.input_model, check_n=args.check_n, perform_optimization=not args.skip_optimization, skip_fuse_bn=not args.enable_fuse_bn, input_shapes=input_shapes, skipped_optimizers=args.skip_optimizer, skip_shape_inference=args.skip_shape_inference) File "E:\ProgramData\Anaconda3\envs\base37\lib\site-packages\onnxsim\onnx_simplifier.py", line 331, in simplify model, const_nodes, input_shapes=input_shapes) File "E:\ProgramData\Anaconda3\envs\base37\lib\site-packages\onnxsim\onnx_simplifier.py", line 172, in forward_for_node_outputs res = forward(model, input_shapes=input_shapes) File "E:\ProgramData\Anaconda3\envs\base37\lib\site-packages\onnxsim\onnx_simplifier.py", line 157, in forward inputs = generate_rand_input(model, input_shapes=input_shapes) File "E:\ProgramData\Anaconda3\envs\base37\lib\site-packages\onnxsim\onnx_simplifier.py", line 108, in generate_rand_input 'please determine the input size manually by --input-shape xxx'.format(key)) RuntimeError: The shape of input "input" has dynamic size, please determine the input size manually by --input-shape xxx
报错,不知道是哪儿有问题?需要加什么参数吗?
你好 我这里也遇到一样的问题,请问你解决了吗?
#236 (comment) 楼主,可以帮帮看一下吗?我这边要C++加载试试模型,C++进行部署测试。但是现在模型无法转换。
这位老师,您的问题解决了吗,我用x86下面的python3.8.13的0.4.1的onnx-simplifier能够实现简化,但是还是有几个胶水op没有解决,大部分胶水op确实去掉了
解决了,可以参考已有 param模型去手动编辑新产生的模型,但是我基于20220721版本的ncnn编译出来的模型,经过修改后,虽然能够加载,但是推理出来的文本是错的,这个目前还没找到原因
有onnx模型,可以自己转哦