Tencent / ncnn

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

onnx2ncnn模型转化有问题,使用了onnxsim也没有解决 #4148

Open huahuahuo opened 2 years ago

huahuahuo commented 2 years ago

error log | 日志或报错信息 | ログ

model | 模型 | モデル

  1. original model

how to reproduce | 复现步骤 | 再現方法

  1. ncnn git master 2.build (mkdir build; cd build;cmake .. \ -DProtobuf_INCLUDE_DIR -DProtobuf_LIBRARY ) 3.cd build/tools/onnx python -m onnxsim a.onnx a_sim.onnx ./onnx2ncnn a_sim.onnx a_sim.parma a_sim.bin

log image

wzyforgit commented 2 years ago

ONNX那边现在没有售后了,如果你的训练框架是pytorch,请用PNNX进行转换,那个有售后

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