ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

onnx2ncnn params not loading

Open soham24 opened this issue 6 years ago • 3 comments

Here is starting of my param file generated by onnx2ncnn. `7767517 199 199 Input input1 0 1 Padding padding 1 1 input1 conv1_pad_output 0=0 1=0 2=0 3=0 4=0 5=0.000000 Convolution convolution 1 1 conv1_pad_output conv1_output 0=8 1=3 11=3 2=1 12=1 3=2 13=2 5=0 6=216

`

it is not loading in ncnn library (load params). 1> as seen below, in input layer, there is no shape/channel declared. is it a problem? well, I tried by adding this to first input layer: 0 1 input1 0=3 1=128 2=128 still params are not loading!

2> In normal param file I see layer has same name in parameter list , but here padding-> conv1_pad_output convolution -> conv1_output and on...

does this makes difference? Do I need to change 'padding' to 'conv1_pad_output' or 'conv1_pad_output' to 'padding'?

soham24 avatar Mar 22 '19 13:03 soham24

你好 我遇到了同样的问题,请问你解决了么

sheng8006 avatar Oct 29 '19 11:10 sheng8006

you can directly run pytorch model on mobile now

soham24 avatar Oct 31 '19 12:10 soham24

针对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 19 '24 03:08 nihui