Tencent / ncnn

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

Yolov5s model conversion and segmentation fault #4195

Open emreaniloguz opened 2 years ago

emreaniloguz commented 2 years ago

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

Segmentation fault (core dumped)

model | 模型 | モデル

  1. original model Yolov5s

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

  1. Download my .bin and .param file
  2. Run the code that I wrote (it differs original ncnn documentation slightly)

I have trained a custom Yolo5s model (from here: https://github.com/ultralytics/yolov5),

Then I converted .pt file to .onnx format with the code that i wrote

import torch
import torch.onnx

model = torch.hub.load('ultralytics/yolov5', 'custom', path="best.pt",force_reload=True)  # default
model = model.cpu()
dummy_input = torch.randn(1, 3, 416, 416)
torch.onnx.export(model, dummy_input, "yolov5s_mobile_phone.onnx")

Then I simplified the onnx model,

onnxsim ../yolov5s_mobile_phone.onnx ../yolov5s_mobile_phone_simplified.onnx

Finally, I converted the simplified onnx model to the .bin and .param format.

onnx2ncnn yolov5s_mobile_phone_simplified.onnx yolov5s.bin yolov5s.param

With the operations above I follow this guide to get an output from my model but, (https://ncnn.docsforge.com/master/wiki-home/#input-data-and-extract-output)

#include<iostream>
#include <opencv2/opencv.hpp>

#include"net.h"

int main(){
    std::cout << "Hello World!" << std::endl;

    cv::Mat image = cv::imread("mfagan.png");

    if (image.empty()){
        std::cout << "Image not found" << std::endl;
        return 1;
    }

    int w = image.cols;
    int h = image.rows;

    //resize image to network input size

    ncnn::Mat in = ncnn::Mat::from_pixels_resize(image.data, ncnn::Mat::PIXEL_RGB, w, h, 416, 416);    //float mean[1] = { 128.f };
    float mean[1] = { 128.f };
    float norm[1] = { 1/128.f };
    in.substract_mean_normalize(mean, norm);

    ncnn::Net net;

    net.load_param("yolov5s.param");
    net.load_model("yolov5s.bin");

    ncnn::Extractor ex = net.create_extractor();
    ex.set_light_mode(true);
    ex.set_num_threads(4);

    ex.input("onnx::Cast_0", in);
    ncnn::Mat feat;
    ex.extract("676", feat);

    return 0;

}

The error

Hello World!
Segmentation fault (core dumped)

My .param file

7767517
210 240
Input            onnx::Cast_0             0 1 onnx::Cast_0
MemoryData       onnx::Add_394            0 1 onnx::Add_394
MemoryData       onnx::Add_511            0 1 onnx::Add_511
MemoryData       onnx::Add_628            0 1 onnx::Add_628
MemoryData       onnx::Mul_418            0 1 onnx::Mul_418
MemoryData       onnx::Mul_535            0 1 onnx::Mul_535
MemoryData       onnx::Mul_652            0 1 onnx::Mul_652
Convolution      Conv_1                   1 1 onnx::Cast_0 input 0=32 1=6 11=6 2=1 12=1 3=2 13=2 4=2 14=2 15=2 16=2 5=1 6=3456
Swish            Mul_3                    1 1 input onnx::Conv_125
Convolution      Conv_4                   1 1 onnx::Conv_125 input.3 0=64 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=18432
Swish            Mul_6                    1 1 input.3 onnx::Conv_128
Split            splitncnn_0              1 2 onnx::Conv_128 onnx::Conv_128_splitncnn_0 onnx::Conv_128_splitncnn_1
Convolution      Conv_7                   1 1 onnx::Conv_128_splitncnn_1 input.7 0=32 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=2048
Swish            Mul_9                    1 1 input.7 onnx::Conv_131
Split            splitncnn_1              1 2 onnx::Conv_131 onnx::Conv_131_splitncnn_0 onnx::Conv_131_splitncnn_1
Convolution      Conv_10                  1 1 onnx::Conv_131_splitncnn_1 input.11 0=32 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=1024
Swish            Mul_12                   1 1 input.11 onnx::Conv_134
Convolution      Conv_13                  1 1 onnx::Conv_134 input.15 0=32 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=9216
Swish            Mul_15                   1 1 input.15 onnx::Add_137
BinaryOp         Add_16                   2 1 onnx::Conv_131_splitncnn_0 onnx::Add_137 onnx::Concat_138 0=0
Convolution      Conv_17                  1 1 onnx::Conv_128_splitncnn_0 input.19 0=32 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=2048
Swish            Mul_19                   1 1 input.19 onnx::Concat_141
Concat           Concat_20                2 1 onnx::Concat_138 onnx::Concat_141 input.23 0=0
Convolution      Conv_21                  1 1 input.23 input.27 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=4096
Swish            Mul_23                   1 1 input.27 onnx::Conv_145
Convolution      Conv_24                  1 1 onnx::Conv_145 input.31 0=128 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=73728
Swish            Mul_26                   1 1 input.31 onnx::Conv_148
Split            splitncnn_2              1 2 onnx::Conv_148 onnx::Conv_148_splitncnn_0 onnx::Conv_148_splitncnn_1
Convolution      Conv_27                  1 1 onnx::Conv_148_splitncnn_1 input.35 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=8192
Swish            Mul_29                   1 1 input.35 onnx::Conv_151
Split            splitncnn_3              1 2 onnx::Conv_151 onnx::Conv_151_splitncnn_0 onnx::Conv_151_splitncnn_1
Convolution      Conv_30                  1 1 onnx::Conv_151_splitncnn_1 input.39 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=4096
Swish            Mul_32                   1 1 input.39 onnx::Conv_154
Convolution      Conv_33                  1 1 onnx::Conv_154 input.43 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=36864
Swish            Mul_35                   1 1 input.43 onnx::Add_157
BinaryOp         Add_36                   2 1 onnx::Conv_151_splitncnn_0 onnx::Add_157 input.47 0=0
Split            splitncnn_4              1 2 input.47 input.47_splitncnn_0 input.47_splitncnn_1
Convolution      Conv_37                  1 1 input.47_splitncnn_1 input.51 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=4096
Swish            Mul_39                   1 1 input.51 onnx::Conv_161
Convolution      Conv_40                  1 1 onnx::Conv_161 input.55 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=36864
Swish            Mul_42                   1 1 input.55 onnx::Add_164
BinaryOp         Add_43                   2 1 input.47_splitncnn_0 onnx::Add_164 onnx::Concat_165 0=0
Convolution      Conv_44                  1 1 onnx::Conv_148_splitncnn_0 input.59 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=8192
Swish            Mul_46                   1 1 input.59 onnx::Concat_168
Concat           Concat_47                2 1 onnx::Concat_165 onnx::Concat_168 input.63 0=0
Convolution      Conv_48                  1 1 input.63 input.67 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384
Swish            Mul_50                   1 1 input.67 onnx::Conv_172
Split            splitncnn_5              1 2 onnx::Conv_172 onnx::Conv_172_splitncnn_0 onnx::Conv_172_splitncnn_1
Convolution      Conv_51                  1 1 onnx::Conv_172_splitncnn_1 input.71 0=256 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=294912
Swish            Mul_53                   1 1 input.71 onnx::Conv_175
Split            splitncnn_6              1 2 onnx::Conv_175 onnx::Conv_175_splitncnn_0 onnx::Conv_175_splitncnn_1
Convolution      Conv_54                  1 1 onnx::Conv_175_splitncnn_1 input.75 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=32768
Swish            Mul_56                   1 1 input.75 onnx::Conv_178
Split            splitncnn_7              1 2 onnx::Conv_178 onnx::Conv_178_splitncnn_0 onnx::Conv_178_splitncnn_1
Convolution      Conv_57                  1 1 onnx::Conv_178_splitncnn_1 input.79 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384
Swish            Mul_59                   1 1 input.79 onnx::Conv_181
Convolution      Conv_60                  1 1 onnx::Conv_181 input.83 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=147456
Swish            Mul_62                   1 1 input.83 onnx::Add_184
BinaryOp         Add_63                   2 1 onnx::Conv_178_splitncnn_0 onnx::Add_184 input.87 0=0
Split            splitncnn_8              1 2 input.87 input.87_splitncnn_0 input.87_splitncnn_1
Convolution      Conv_64                  1 1 input.87_splitncnn_1 input.91 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384
Swish            Mul_66                   1 1 input.91 onnx::Conv_188
Convolution      Conv_67                  1 1 onnx::Conv_188 input.95 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=147456
Swish            Mul_69                   1 1 input.95 onnx::Add_191
BinaryOp         Add_70                   2 1 input.87_splitncnn_0 onnx::Add_191 input.99 0=0
Split            splitncnn_9              1 2 input.99 input.99_splitncnn_0 input.99_splitncnn_1
Convolution      Conv_71                  1 1 input.99_splitncnn_1 input.103 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384
Swish            Mul_73                   1 1 input.103 onnx::Conv_195
Convolution      Conv_74                  1 1 onnx::Conv_195 input.107 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=147456
Swish            Mul_76                   1 1 input.107 onnx::Add_198
BinaryOp         Add_77                   2 1 input.99_splitncnn_0 onnx::Add_198 onnx::Concat_199 0=0
Convolution      Conv_78                  1 1 onnx::Conv_175_splitncnn_0 input.111 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=32768
Swish            Mul_80                   1 1 input.111 onnx::Concat_202
Concat           Concat_81                2 1 onnx::Concat_199 onnx::Concat_202 input.115 0=0
Convolution      Conv_82                  1 1 input.115 input.119 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=65536
Swish            Mul_84                   1 1 input.119 onnx::Conv_206
Split            splitncnn_10             1 2 onnx::Conv_206 onnx::Conv_206_splitncnn_0 onnx::Conv_206_splitncnn_1
Convolution      Conv_85                  1 1 onnx::Conv_206_splitncnn_1 input.123 0=512 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=1179648
Swish            Mul_87                   1 1 input.123 onnx::Conv_209
Split            splitncnn_11             1 2 onnx::Conv_209 onnx::Conv_209_splitncnn_0 onnx::Conv_209_splitncnn_1
Convolution      Conv_88                  1 1 onnx::Conv_209_splitncnn_1 input.127 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=131072
Swish            Mul_90                   1 1 input.127 onnx::Conv_212
Split            splitncnn_12             1 2 onnx::Conv_212 onnx::Conv_212_splitncnn_0 onnx::Conv_212_splitncnn_1
Convolution      Conv_91                  1 1 onnx::Conv_212_splitncnn_1 input.131 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=65536
Swish            Mul_93                   1 1 input.131 onnx::Conv_215
Convolution      Conv_94                  1 1 onnx::Conv_215 input.135 0=256 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=589824
Swish            Mul_96                   1 1 input.135 onnx::Add_218
BinaryOp         Add_97                   2 1 onnx::Conv_212_splitncnn_0 onnx::Add_218 onnx::Concat_219 0=0
Convolution      Conv_98                  1 1 onnx::Conv_209_splitncnn_0 input.139 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=131072
Swish            Mul_100                  1 1 input.139 onnx::Concat_222
Concat           Concat_101               2 1 onnx::Concat_219 onnx::Concat_222 input.143 0=0
Convolution      Conv_102                 1 1 input.143 input.147 0=512 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=262144
Swish            Mul_104                  1 1 input.147 onnx::Conv_226
Convolution      Conv_105                 1 1 onnx::Conv_226 input.151 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=131072
Swish            Mul_107                  1 1 input.151 onnx::MaxPool_229
Split            splitncnn_13             1 2 onnx::MaxPool_229 onnx::MaxPool_229_splitncnn_0 onnx::MaxPool_229_splitncnn_1
Pooling          MaxPool_108              1 1 onnx::MaxPool_229_splitncnn_1 onnx::MaxPool_230 0=0 1=5 11=5 2=1 12=1 3=2 13=2 14=2 15=2 5=1
Split            splitncnn_14             1 2 onnx::MaxPool_230 onnx::MaxPool_230_splitncnn_0 onnx::MaxPool_230_splitncnn_1
Pooling          MaxPool_109              1 1 onnx::MaxPool_230_splitncnn_1 onnx::MaxPool_231 0=0 1=5 11=5 2=1 12=1 3=2 13=2 14=2 15=2 5=1
Split            splitncnn_15             1 2 onnx::MaxPool_231 onnx::MaxPool_231_splitncnn_0 onnx::MaxPool_231_splitncnn_1
Pooling          MaxPool_110              1 1 onnx::MaxPool_231_splitncnn_1 onnx::Concat_232 0=0 1=5 11=5 2=1 12=1 3=2 13=2 14=2 15=2 5=1
Concat           Concat_111               4 1 onnx::MaxPool_229_splitncnn_0 onnx::MaxPool_230_splitncnn_0 onnx::MaxPool_231_splitncnn_0 onnx::Concat_232 input.155 0=0
Convolution      Conv_112                 1 1 input.155 input.159 0=512 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=524288
Swish            Mul_114                  1 1 input.159 onnx::Conv_236
Convolution      Conv_115                 1 1 onnx::Conv_236 input.163 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=131072
Swish            Mul_117                  1 1 input.163 onnx::Upsample_239
Split            splitncnn_16             1 2 onnx::Upsample_239 onnx::Upsample_239_splitncnn_0 onnx::Upsample_239_splitncnn_1
Interp           Upsample_118             1 1 onnx::Upsample_239_splitncnn_1 onnx::Concat_243 0=1 1=2.000000e+00 2=2.000000e+00 6=0
Concat           Concat_119               2 1 onnx::Concat_243 onnx::Conv_206_splitncnn_0 input.167 0=0
Split            splitncnn_17             1 2 input.167 input.167_splitncnn_0 input.167_splitncnn_1
Convolution      Conv_120                 1 1 input.167_splitncnn_1 input.171 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=65536
Swish            Mul_122                  1 1 input.171 onnx::Conv_247
Convolution      Conv_123                 1 1 onnx::Conv_247 input.175 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384
Swish            Mul_125                  1 1 input.175 onnx::Conv_250
Convolution      Conv_126                 1 1 onnx::Conv_250 input.179 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=147456
Swish            Mul_128                  1 1 input.179 onnx::Concat_253
Convolution      Conv_129                 1 1 input.167_splitncnn_0 input.183 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=65536
Swish            Mul_131                  1 1 input.183 onnx::Concat_256
Concat           Concat_132               2 1 onnx::Concat_253 onnx::Concat_256 input.187 0=0
Convolution      Conv_133                 1 1 input.187 input.191 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=65536
Swish            Mul_135                  1 1 input.191 onnx::Conv_260
Convolution      Conv_136                 1 1 onnx::Conv_260 input.195 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=32768
Swish            Mul_138                  1 1 input.195 onnx::Upsample_263
Split            splitncnn_18             1 2 onnx::Upsample_263 onnx::Upsample_263_splitncnn_0 onnx::Upsample_263_splitncnn_1
Interp           Upsample_139             1 1 onnx::Upsample_263_splitncnn_1 onnx::Concat_267 0=1 1=2.000000e+00 2=2.000000e+00 6=0
Concat           Concat_140               2 1 onnx::Concat_267 onnx::Conv_172_splitncnn_0 input.199 0=0
Split            splitncnn_19             1 2 input.199 input.199_splitncnn_0 input.199_splitncnn_1
Convolution      Conv_141                 1 1 input.199_splitncnn_1 input.203 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384
Swish            Mul_143                  1 1 input.203 onnx::Conv_271
Convolution      Conv_144                 1 1 onnx::Conv_271 input.207 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=4096
Swish            Mul_146                  1 1 input.207 onnx::Conv_274
Convolution      Conv_147                 1 1 onnx::Conv_274 input.211 0=64 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=36864
Swish            Mul_149                  1 1 input.211 onnx::Concat_277
Convolution      Conv_150                 1 1 input.199_splitncnn_0 input.215 0=64 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384
Swish            Mul_152                  1 1 input.215 onnx::Concat_280
Concat           Concat_153               2 1 onnx::Concat_277 onnx::Concat_280 input.219 0=0
Convolution      Conv_154                 1 1 input.219 input.223 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384
Swish            Mul_156                  1 1 input.223 onnx::Conv_284
Split            splitncnn_20             1 2 onnx::Conv_284 onnx::Conv_284_splitncnn_0 onnx::Conv_284_splitncnn_1
Convolution      Conv_157                 1 1 onnx::Conv_284_splitncnn_1 input.227 0=128 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=147456
Swish            Mul_159                  1 1 input.227 onnx::Concat_287
Concat           Concat_160               2 1 onnx::Concat_287 onnx::Upsample_263_splitncnn_0 input.231 0=0
Split            splitncnn_21             1 2 input.231 input.231_splitncnn_0 input.231_splitncnn_1
Convolution      Conv_161                 1 1 input.231_splitncnn_1 input.235 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=32768
Swish            Mul_163                  1 1 input.235 onnx::Conv_291
Convolution      Conv_164                 1 1 onnx::Conv_291 input.239 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=16384
Swish            Mul_166                  1 1 input.239 onnx::Conv_294
Convolution      Conv_167                 1 1 onnx::Conv_294 input.243 0=128 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=147456
Swish            Mul_169                  1 1 input.243 onnx::Concat_297
Convolution      Conv_170                 1 1 input.231_splitncnn_0 input.247 0=128 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=32768
Swish            Mul_172                  1 1 input.247 onnx::Concat_300
Concat           Concat_173               2 1 onnx::Concat_297 onnx::Concat_300 input.251 0=0
Convolution      Conv_174                 1 1 input.251 input.255 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=65536
Swish            Mul_176                  1 1 input.255 onnx::Conv_304
Split            splitncnn_22             1 2 onnx::Conv_304 onnx::Conv_304_splitncnn_0 onnx::Conv_304_splitncnn_1
Convolution      Conv_177                 1 1 onnx::Conv_304_splitncnn_1 input.259 0=256 1=3 11=3 2=1 12=1 3=2 13=2 4=1 14=1 15=1 16=1 5=1 6=589824
Swish            Mul_179                  1 1 input.259 onnx::Concat_307
Concat           Concat_180               2 1 onnx::Concat_307 onnx::Upsample_239_splitncnn_0 input.263 0=0
Split            splitncnn_23             1 2 input.263 input.263_splitncnn_0 input.263_splitncnn_1
Convolution      Conv_181                 1 1 input.263_splitncnn_1 input.267 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=131072
Swish            Mul_183                  1 1 input.267 onnx::Conv_311
Convolution      Conv_184                 1 1 onnx::Conv_311 input.271 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=65536
Swish            Mul_186                  1 1 input.271 onnx::Conv_314
Convolution      Conv_187                 1 1 onnx::Conv_314 input.275 0=256 1=3 11=3 2=1 12=1 3=1 13=1 4=1 14=1 15=1 16=1 5=1 6=589824
Swish            Mul_189                  1 1 input.275 onnx::Concat_317
Convolution      Conv_190                 1 1 input.263_splitncnn_0 input.279 0=256 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=131072
Swish            Mul_192                  1 1 input.279 onnx::Concat_320
Concat           Concat_193               2 1 onnx::Concat_317 onnx::Concat_320 input.283 0=0
Convolution      Conv_194                 1 1 input.283 input.287 0=512 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=262144
Swish            Mul_196                  1 1 input.287 onnx::Conv_324
Convolution      Conv_197                 1 1 onnx::Conv_284_splitncnn_0 onnx::Reshape_325 0=18 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=2304
Reshape          Reshape_198              1 1 onnx::Reshape_325 onnx::Transpose_337 0=2704 1=6 2=3
Permute          Transpose_199            1 1 onnx::Transpose_337 onnx::Sigmoid_338 0=1
Sigmoid          Sigmoid_246              1 1 onnx::Sigmoid_338 y
Slice            Split_247                1 3 y onnx::Mul_420 onnx::Mul_421 onnx::Concat_422 -23300=3,2,2,-233 1=3
BinaryOp         Mul_249                  1 1 onnx::Mul_420 onnx::Add_424 0=2 1=1 2=2.000000e+00
BinaryOp         Add_250                  2 1 onnx::Add_424 onnx::Add_394 onnx::Mul_425 0=0
BinaryOp         Mul_252                  1 1 onnx::Mul_425 onnx::Concat_427 0=2 1=1 2=8.000000e+00
BinaryOp         Mul_254                  1 1 onnx::Mul_421 onnx::Pow_429 0=2 1=1 2=2.000000e+00
BinaryOp         Pow_255                  1 1 onnx::Pow_429 onnx::Mul_432 0=6 1=1 2=2.000000e+00
BinaryOp         Mul_256                  2 1 onnx::Mul_432 onnx::Mul_418 onnx::Concat_433 0=2
Concat           Concat_257               3 1 onnx::Concat_427 onnx::Concat_433 onnx::Concat_422 onnx::Reshape_434 0=3
Reshape          Reshape_258              1 1 onnx::Reshape_434 onnx::Concat_441 0=6 1=-1
Convolution      Conv_259                 1 1 onnx::Conv_304_splitncnn_0 onnx::Reshape_442 0=18 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=4608
Reshape          Reshape_260              1 1 onnx::Reshape_442 onnx::Transpose_454 0=676 1=6 2=3
Permute          Transpose_261            1 1 onnx::Transpose_454 onnx::Sigmoid_455 0=1
Sigmoid          Sigmoid_308              1 1 onnx::Sigmoid_455 y.3
Slice            Split_309                1 3 y.3 onnx::Mul_537 onnx::Mul_538 onnx::Concat_539 -23300=3,2,2,-233 1=3
BinaryOp         Mul_311                  1 1 onnx::Mul_537 onnx::Add_541 0=2 1=1 2=2.000000e+00
BinaryOp         Add_312                  2 1 onnx::Add_541 onnx::Add_511 onnx::Mul_542 0=0
BinaryOp         Mul_314                  1 1 onnx::Mul_542 onnx::Concat_544 0=2 1=1 2=1.600000e+01
BinaryOp         Mul_316                  1 1 onnx::Mul_538 onnx::Pow_546 0=2 1=1 2=2.000000e+00
BinaryOp         Pow_317                  1 1 onnx::Pow_546 onnx::Mul_549 0=6 1=1 2=2.000000e+00
BinaryOp         Mul_318                  2 1 onnx::Mul_549 onnx::Mul_535 onnx::Concat_550 0=2
Concat           Concat_319               3 1 onnx::Concat_544 onnx::Concat_550 onnx::Concat_539 onnx::Reshape_551 0=3
Reshape          Reshape_320              1 1 onnx::Reshape_551 onnx::Concat_558 0=6 1=-1
Convolution      Conv_321                 1 1 onnx::Conv_324 onnx::Reshape_559 0=18 1=1 11=1 2=1 12=1 3=1 13=1 4=0 14=0 15=0 16=0 5=1 6=9216
Reshape          Reshape_322              1 1 onnx::Reshape_559 onnx::Transpose_571 0=169 1=6 2=3
Permute          Transpose_323            1 1 onnx::Transpose_571 onnx::Sigmoid_572 0=1
Sigmoid          Sigmoid_370              1 1 onnx::Sigmoid_572 y.7
Slice            Split_371                1 3 y.7 onnx::Mul_654 onnx::Mul_655 onnx::Concat_656 -23300=3,2,2,-233 1=3
BinaryOp         Mul_373                  1 1 onnx::Mul_654 onnx::Add_658 0=2 1=1 2=2.000000e+00
BinaryOp         Add_374                  2 1 onnx::Add_658 onnx::Add_628 onnx::Mul_659 0=0
BinaryOp         Mul_376                  1 1 onnx::Mul_659 onnx::Concat_661 0=2 1=1 2=3.200000e+01
BinaryOp         Mul_378                  1 1 onnx::Mul_655 onnx::Pow_663 0=2 1=1 2=2.000000e+00
BinaryOp         Pow_379                  1 1 onnx::Pow_663 onnx::Mul_666 0=6 1=1 2=2.000000e+00
BinaryOp         Mul_380                  2 1 onnx::Mul_666 onnx::Mul_652 onnx::Concat_667 0=2
Concat           Concat_381               3 1 onnx::Concat_661 onnx::Concat_667 onnx::Concat_656 onnx::Reshape_668 0=3
Reshape          Reshape_382              1 1 onnx::Reshape_668 onnx::Concat_675 0=6 1=-1
Concat           Concat_383               3 1 onnx::Concat_441 onnx::Concat_558 onnx::Concat_675 676 0=0
emreaniloguz commented 2 years ago

You can download files from here;

https://drive.google.com/drive/folders/1BvyEBIf1n-8i7NRU5qznxPUQdLtbW9dH?usp=sharing

xudahong commented 2 years ago

hello,have you solved this problem? i had the same problem.

emreaniloguz commented 2 years ago

hello,have you solved this problem? i had the same problem.

Yeah, I have solved the problem. I'm trying to prepare a repo about this issue, when it is finished I will be sharing it from here.

xudahong commented 2 years ago

hello,have you solved this problem? i had the same problem.

Yeah, I have solved the problem. I'm trying to prepare a repo about this issue, when it is finished I will be sharing it from here.

ok,thanks a lot

dtiny commented 2 years ago

hello,have you solved this problem? i had the same problem.

Yeah, I have solved the problem. I'm trying to prepare a repo about this issue, when it is finished I will be sharing it from here.

hello, i had the same problem. could you share to solve it.

pastukhov-aleksandr commented 1 year ago

hello,have you solved this problem? i had the same problem.

Yeah, I have solved the problem. I'm trying to prepare a repo about this issue, when it is finished I will be sharing it from here.

could you share to solve it. Pls!

nihui commented 3 months 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