ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

加载存在inf的param会出现段错误

Open cgoxopx opened this issue 3 years ago • 1 comments

param文件:

...
InnerProduct     MatMul_39                1 1 onnx::MatMul_354 mel_spectrogram 0=229 1=0 2=234725
Clip             Clip_40                  1 1 mel_spectrogram onnx::Log_360 0=1.000000e-10 1=inf     #报错的位置
UnaryOp          Log_41                   1 1 onnx::Log_360 onnx::Div_361 0=8
...

报错:

ParamDict parse value failed
ParamDict load_param 23 Clip_40 failed
段错误 (核心已转储)

将inf改为数字后就不报错了

cgoxopx avatar Apr 22 '23 09:04 cgoxopx

针对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

nihui avatar Aug 05 '24 09:08 nihui