Open niwch opened 2 years 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
detail | 详细描述 | 詳細な説明
像是模型刚开始就错误了,请问是模型还是代码加载的问题?
code执行到Reshape_vulkan::forward函数返回-100 Reshape_vulkan::forward w = -233 , h = -233 , d = -233, c = -233 , ndim = 0 permute = 0
模型param 如下: 7767517 213 237 Input input1 0 1 input1 MemoryData onnx::Add_952 0 1 onnx::Add_952 0=1024 1=1025 MemoryData onnx::Concat_124 0 1 onnx::Concat_124 0=1024 1=1 MemoryData vit.to_patch_embedding.1.bias 0 1 vit.to_patch_embedding.1.bias 0=1024 MemoryData vit.transformer.layers.0.0.fn.to_out.0.bias 0 1 vit.transformer.layers.0.0.fn.to_out.0.bias 0=1024 MemoryData vit.transformer.layers.0.1.fn.net.0.bias 0 1 vit.transformer.layers.0.1.fn.net.0.bias 0=1024 MemoryData vit.transformer.layers.0.1.fn.net.3.bias 0 1 vit.transformer.layers.0.1.fn.net.3.bias 0=1024 MemoryData vit.transformer.layers.1.0.fn.to_out.0.bias 0 1 vit.transformer.layers.1.0.fn.to_out.0.bias 0=1024 MemoryData vit.transformer.layers.1.1.fn.net.0.bias 0 1 vit.transformer.layers.1.1.fn.net.0.bias 0=1024 MemoryData vit.transformer.layers.1.1.fn.net.3.bias 0 1 vit.transformer.layers.1.1.fn.net.3.bias 0=1024 MemoryData vit.transformer.layers.2.0.fn.to_out.0.bias 0 1 vit.transformer.layers.2.0.fn.to_out.0.bias 0=1024 MemoryData vit.transformer.layers.2.1.fn.net.0.bias 0 1 vit.transformer.layers.2.1.fn.net.0.bias 0=1024 MemoryData vit.transformer.layers.2.1.fn.net.3.bias 0 1 vit.transformer.layers.2.1.fn.net.3.bias 0=1024 MemoryData vit.transformer.layers.3.0.fn.to_out.0.bias 0 1 vit.transformer.layers.3.0.fn.to_out.0.bias 0=1024 MemoryData vit.transformer.layers.3.1.fn.net.0.bias 0 1 vit.transformer.layers.3.1.fn.net.0.bias 0=1024 MemoryData vit.transformer.layers.3.1.fn.net.3.bias 0 1 vit.transformer.layers.3.1.fn.net.3.bias 0=1024 MemoryData vit.transformer.layers.4.0.fn.to_out.0.bias 0 1 vit.transformer.layers.4.0.fn.to_out.0.bias 0=1024 MemoryData vit.transformer.layers.4.1.fn.net.0.bias 0 1 vit.transformer.layers.4.1.fn.net.0.bias 0=1024 MemoryData vit.transformer.layers.4.1.fn.net.3.bias 0 1 vit.transformer.layers.4.1.fn.net.3.bias 0=1024 MemoryData vit.transformer.layers.5.0.fn.to_out.0.bias 0 1 vit.transformer.layers.5.0.fn.to_out.0.bias 0=1024 MemoryData vit.transformer.layers.5.1.fn.net.0.bias 0 1 vit.transformer.layers.5.1.fn.net.0.bias 0=1024 MemoryData vit.transformer.layers.5.1.fn.net.3.bias 0 1 vit.transformer.layers.5.1.fn.net.3.bias 0=1024
执行到Reshape错误
Reshape Reshape_45 1 1 input1 tensor
Permute Transpose_46 1 1 tensor tensor.4 Reshape Reshape_47 1 1 tensor.4 onnx::MatMul_96 0=768 1=1024 InnerProduct MatMul_48 1 1 onnx::MatMul_96 onnx::Add_98 0=1024 1=0 2=786432