Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.17k stars 4.15k forks source link

ocr模型lstm转换后 ,模型单输出变多输出(每个lstm增加两个输出),运行后FATAL ERROR! pool allocator destroyed too early #3306

Open yank666 opened 2 years ago

yank666 commented 2 years ago

@nihui ,倪大求助 我的ocr模型转换后,推理后会报 FATAL ERROR! pool allocator destroyed too early 0x5590370415e0 still in use 其他检测模型转换后就不会有析构报错

压缩包里是模型 和转换后的ncnn模型 model.zip

image

yank666 commented 2 years ago

原始模型config: https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.3/configs/rec/ch_PP-OCRv2/ch_PP-OCRv2_rec.yml paddle ocr的模型:

lQLPDhrP1efVy-nNAnLNAgKwRY4y255-i6ABgcK2BEBPAA_514_626

模型 导出成paddle model image

paddle model to onnx paddle2onnx --model_dir paddle_model --save_file onnx_file --opset_version 11 --enable_onnx_checker True

nihui commented 2 years ago

请尝试最新版 ncnn,应该修复这个问题了

lgcy commented 2 years ago

请尝试最新版 ncnn,应该修复这个问题了

@nihui 倪大,1122版本依旧存在这个问题

nihui commented 1 month ago

针对onnx模型转换的各种问题,推荐使用最新的pnnx工具转换到ncnn In view of various problems in onnx model conversion, it is recommended to use the latest pnnx tool to convert your model to ncnn

pip install pnnx
pnnx model.onnx inputshape=[1,3,224,224]

详细参考文档 Detailed reference documentation https://github.com/pnnx/pnnx https://github.com/Tencent/ncnn/wiki/use-ncnn-with-pytorch-or-onnx#how-to-use-pnnx