Tencent / ncnn

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

[CRNN][ncnn2table]Segmentation fault (core dumped) #2970

Open jinmingyi1998 opened 3 years ago

jinmingyi1998 commented 3 years ago
ncnn2table crnn-opt.param crnn-opt.bin /tmp/imagelist.txt crnn.table mean=[128] norm=[0.007] s$ape=[32,128,1] pixel=GRAY thread=24 method=kl                                                                                                                                                                         
mean = [128.000000]                                                                                                                                                                                                   
norm = [0.007000]                                                                                                                                                                                                     
shape = [32,128,1]                                                                                                                                                                                                    
pixel = GRAY                                                                                                                                                                                                          thread = 24                                                                                                                                                                                                           
method = kl                                                                                                                                                                                                           
---------------------------------------                                                                                                                                                                               count the absmax 0.00% [ 0 / 9459 ]                                                                                                                                                                                   
count the absmax 1.06% [ 100 / 9459 ]
count the absmax 2.11% [ 200 / 9459 ]
count the absmax 4.23% [ 400 / 9459 ]
count the absmax 3.17% [ 300 / 9459 ]
.....
count the absmax 81.40% [ 7700 / 9459 ]
count the absmax 82.46% [ 7800 / 9459 ]
count the absmax 83.52% [ 7900 / 9459 ]
count the absmax 84.58% [ 8000 / 9459 ]
count the absmax 85.63% [ 8100 / 9459 ]
count the absmax 86.69% [ 8200 / 9459 ]
count the absmax 87.75% [ 8300 / 9459 ]
count the absmax 88.80% [ 8400 / 9459 ]
count the absmax 89.86% [ 8500 / 9459 ]
count the absmax 90.92% [ 8600 / 9459 ]
count the absmax 91.98% [ 8700 / 9459 ]
count the absmax 93.03% [ 8800 / 9459 ]
count the absmax 95.15% [ 9000 / 9459 ]
count the absmax 96.20% [ 9100 / 9459 ]
count the absmax 94.09% [ 8900 / 9459 ]
count the absmax 97.26% [ 9200 / 9459 ]
count the absmax 98.32% [ 9300 / 9459 ]
count the absmax 99.38% [ 9400 / 9459 ]
build histogram 0.00% [ 0 / 9459 ]
Segmentation fault (core dumped) 

param:

mobilenet V3 + 1 LSTM

cat crnn-opt.param
7767517                                                                                                                                                                                                               155 174                                                                                                                                                                                                               Input                    images                   0 1 images                                                                                                                                                          Convolution              326                      1 1 images 327 0=8 1=3 3=2 4=1 5=1 6=72                                                                                                                             HardSwish                333                      1 1 327 333 0=1.666667e-01                                                                                                                                          Split                    splitncnn_0              1 2 333 333_splitncnn_0 333_splitncnn_1                                                                                                                             Convolution              334                      1 1 333_splitncnn_1 336 0=8 1=1 5=1 6=64 9=1                                                                                                                        ConvolutionDepthWise     337                      1 1 336 339 0=8 1=3 4=1 5=1 6=72 7=8 9=1                                                                                                                            Convolution              340                      1 1 339 341 0=8 1=1 5=1 6=64                                                                                                                                        BinaryOp                 342                      2 1 333_splitncnn_0 341 342                                                                                                                                         Convolution              343                      1 1 342 345 0=32 1=1 5=1 6=256 9=1                                                                                                                                  ConvolutionDepthWise     346                      1 1 345 348 0=32 1=3 13=2 4=1 5=1 6=288 7=32 9=1                                                                                                                    Convolution              349                      1 1 348 350 0=16 1=1 5=1 6=512                                                                                                                                      Split                    splitncnn_1              1 2 350 350_splitncnn_0 350_splitncnn_1                                                                                                                             Convolution              351                      1 1 350_splitncnn_1 353 0=40 1=1 5=1 6=640 9=1                                                                                                                      ConvolutionDepthWise     354                      1 1 353 356 0=40 1=3 4=1 5=1 6=360 7=40 9=1                                                                                                                         Convolution              357                      1 1 356 358 0=16 1=1 5=1 6=640                                                                                                                                      BinaryOp                 359                      2 1 350_splitncnn_0 358 359                                                                                                                                         Convolution              360                      1 1 359 362 0=40 1=1 5=1 6=640 9=1                                                                                                                                  ConvolutionDepthWise     363                      1 1 362 365 0=40 1=5 13=2 4=2 5=1 6=1000 7=40 9=1                                                                                                                   Split                    splitncnn_2              1 2 365 365_splitncnn_0 365_splitncnn_1                                                                                                                             Pooling                  366                      1 1 365_splitncnn_1 366 0=1 4=1                                                                                                                                     InnerProduct             367                      1 1 366 368 0=10 1=1 2=400 9=1                                                                                                                                      InnerProduct             369                      1 1 368 369 0=40 1=1 2=400                                                                                                                                          BinaryOp                 371                      1 1 369 371 0=2 1=1 2=1.200000e+00                                                                                                                                  HardSigmoid              376                      1 1 371 376 0=1.666667e-01                                                                                                                                          BinaryOp                 377                      2 1 365_splitncnn_0 376 377 0=2                                                                                                                                     Convolution              378                      1 1 377 379 0=24 1=1 5=1 6=960                                                                                                                                      Split                    splitncnn_3              1 2 379 379_splitncnn_0 379_splitncnn_1                                                                                                                             Convolution              380                      1 1 379_splitncnn_1 382 0=64 1=1 5=1 6=1536 9=1                                                                                                                     ConvolutionDepthWise     383                      1 1 382 385 0=64 1=5 4=2 5=1 6=1600 7=64 9=1                                                                                                                        Split                    splitncnn_4              1 2 385 385_splitncnn_0 385_splitncnn_1                                                                                                                             Pooling                  386                      1 1 385_splitncnn_1 386 0=1 4=1                                                                                                                                     InnerProduct             387                      1 1 386 388 0=16 1=1 2=1024 9=1                                                                                                                                     InnerProduct             389                      1 1 388 389 0=64 1=1 2=1024                                                                                                                                         BinaryOp                 391                      1 1 389 391 0=2 1=1 2=1.200000e+00                                                                                                                                  HardSigmoid              396                      1 1 391 396 0=1.666667e-01                                                                                                                                          BinaryOp                 397                      2 1 385_splitncnn_0 396 397 0=2                                                                                                                                     Convolution              398                      1 1 397 399 0=24 1=1 5=1 6=1536 
BinaryOp                 400                      2 1 379_splitncnn_0 399 400
Split                    splitncnn_5              1 2 400 400_splitncnn_0 400_splitncnn_1
Convolution              401                      1 1 400_splitncnn_1 403 0=64 1=1 5=1 6=1536 9=1
ConvolutionDepthWise     404                      1 1 403 406 0=64 1=5 4=2 5=1 6=1600 7=64 9=1
Split                    splitncnn_6              1 2 406 406_splitncnn_0 406_splitncnn_1
Pooling                  407                      1 1 406_splitncnn_1 407 0=1 4=1
InnerProduct             408                      1 1 407 409 0=16 1=1 2=1024 9=1
InnerProduct             410                      1 1 409 410 0=64 1=1 2=1024
BinaryOp                 412                      1 1 410 412 0=2 1=1 2=1.200000e+00
HardSigmoid              417                      1 1 412 417 0=1.666667e-01
BinaryOp                 418                      2 1 406_splitncnn_0 417 418 0=2
Convolution              419                      1 1 418 420 0=24 1=1 5=1 6=1536
BinaryOp                 421                      2 1 400_splitncnn_0 420 421
Convolution              422                      1 1 421 423 0=120 1=1 5=1 6=2880
HardSwish                429                      1 1 423 429 0=1.666667e-01
ConvolutionDepthWise     430                      1 1 429 431 0=120 1=3 4=1 5=1 6=1080 7=120
HardSwish                437                      1 1 431 437 0=1.666667e-01
Convolution              438                      1 1 437 439 0=40 1=1 5=1 6=4800
Split                    splitncnn_7              1 2 439 439_splitncnn_0 439_splitncnn_1
Convolution              440                      1 1 439_splitncnn_1 441 0=104 1=1 5=1 6=4160
HardSwish                447                      1 1 441 447 0=1.666667e-01
ConvolutionDepthWise     448                      1 1 447 449 0=104 1=3 4=1 5=1 6=936 7=104
HardSwish                455                      1 1 449 455 0=1.666667e-01
Convolution              456                      1 1 455 457 0=40 1=1 5=1 6=4160
BinaryOp                 458                      2 1 439_splitncnn_0 457 458                                                                                                                                         Split                    splitncnn_8              1 2 458 458_splitncnn_0 458_splitncnn_1                                                                                                                             Convolution              459                      1 1 458_splitncnn_1 460 0=96 1=1 5=1 6=3840                                                                                                                         HardSwish                466                      1 1 460 466 0=1.666667e-01                                                                                                                                          ConvolutionDepthWise     467                      1 1 466 468 0=96 1=3 4=1 5=1 6=864 7=96                                                                                                                             HardSwish                474                      1 1 468 474 0=1.666667e-01                                                                                                                                          Convolution              475                      1 1 474 476 0=40 1=1 5=1 6=3840                                                                                                                                     BinaryOp                 477                      2 1 458_splitncnn_0 476 477                                                                                                                                         Split                    splitncnn_9              1 2 477 477_splitncnn_0 477_splitncnn_1                                                                                                                             Convolution              478                      1 1 477_splitncnn_1 479 0=96 1=1 5=1 6=3840                                                                                                                         HardSwish                485                      1 1 479 485 0=1.666667e-01                                                                                                                                          ConvolutionDepthWise     486                      1 1 485 487 0=96 1=3 4=1 5=1 6=864 7=96                                                                                                                             HardSwish                493                      1 1 487 493 0=1.666667e-01                                                                                                                                          Convolution              494                      1 1 493 495 0=40 1=1 5=1 6=3840                                                                                                                                     BinaryOp                 496                      2 1 477_splitncnn_0 495 496                                                                                                                                         Convolution              497                      1 1 496 498 0=240 1=1 5=1 6=9600                                                                                                                                    HardSwish                504                      1 1 498 504 0=1.666667e-01                                                                                                                                          ConvolutionDepthWise     505                      1 1 504 506 0=240 1=3 4=1 5=1 6=2160 7=240                                                                                                                          HardSwish                512                      1 1 506 512 0=1.666667e-01                                                                                                                                          Split                    splitncnn_10             1 2 512 512_splitncnn_0 512_splitncnn_1                                                                                                                             Pooling                  513                      1 1 512_splitncnn_1 513 0=1 4=1                                                                                                                                     InnerProduct             514                      1 1 513 515 0=60 1=1 2=14400 9=1                                                                                                                                    InnerProduct             516                      1 1 515 516 0=240 1=1 2=14400                                                                                                                                       BinaryOp                 518                      1 1 516 518 0=2 1=1 2=1.200000e+00                                                                                                                                  HardSigmoid              523                      1 1 518 523 0=1.666667e-01                                                                                                                                          BinaryOp                 524                      2 1 512_splitncnn_0 523 524 0=2                                                                                                                                     Convolution              525                      1 1 524 526 0=56 1=1 5=1 6=13440                                                                                                                                    Split                    splitncnn_11             1 2 526 526_splitncnn_0 526_splitncnn_1                                                                                                                             Convolution              527                      1 1 526_splitncnn_1 528 0=336 1=1 5=1 6=18816                                                                                                                       HardSwish                534                      1 1 528 534 0=1.666667e-01                                                                                                                                          ConvolutionDepthWise     535                      1 1 534 536 0=336 1=3 4=1 5=1 6=3024 7=336                                                                                                                          HardSwish                542                      1 1 536 542 0=1.666667e-01                                                                                                                                          Split                    splitncnn_12             1 2 542 542_splitncnn_0 542_splitncnn_1                                                                                                                             Pooling                  543                      1 1 542_splitncnn_1 543 0=1 4=1                                                                                                                                     InnerProduct             544                      1 1 543 545 0=84 1=1 2=28224 9=1                                                                                                                                    InnerProduct             546                      1 1 545 546 0=336 1=1 2=28224                                                                                                                                       BinaryOp                 548                      1 1 546 548 0=2 1=1 2=1.200000e+00                                                                                                                                  HardSigmoid              553                      1 1 548 553 0=1.666667e-01                                                                                                                                          BinaryOp                 554                      2 1 542_splitncnn_0 553 554 0=2                                                                                                                                     Convolution              555                      1 1 554 556 0=56 1=1 5=1 6=18816                                                                                                                                    BinaryOp                 557                      2 1 526_splitncnn_0 556 557                                                                                                                                         Convolution              558                      1 1 557 559 0=336 1=1 5=1 6=18816
HardSwish                565                      1 1 559 565 0=1.666667e-01
ConvolutionDepthWise     566                      1 1 565 567 0=336 1=5 13=2 4=2 5=1 6=8400 7=336
HardSwish                573                      1 1 567 573 0=1.666667e-01
Split                    splitncnn_13             1 2 573 573_splitncnn_0 573_splitncnn_1
Pooling                  574                      1 1 573_splitncnn_1 574 0=1 4=1
InnerProduct             575                      1 1 574 576 0=84 1=1 2=28224 9=1
InnerProduct             577                      1 1 576 577 0=336 1=1 2=28224
BinaryOp                 579                      1 1 577 579 0=2 1=1 2=1.200000e+00
HardSigmoid              584                      1 1 579 584 0=1.666667e-01
BinaryOp                 585                      2 1 573_splitncnn_0 584 585 0=2
Convolution              586                      1 1 585 587 0=80 1=1 5=1 6=26880
Split                    splitncnn_14             1 2 587 587_splitncnn_0 587_splitncnn_1
Convolution              588                      1 1 587_splitncnn_1 589 0=480 1=1 5=1 6=38400
HardSwish                595                      1 1 589 595 0=1.666667e-01
ConvolutionDepthWise     596                      1 1 595 597 0=480 1=5 4=2 5=1 6=12000 7=480
HardSwish                603                      1 1 597 603 0=1.666667e-01
Split                    splitncnn_15             1 2 603 603_splitncnn_0 603_splitncnn_1
Pooling                  604                      1 1 603_splitncnn_1 604 0=1 4=1
InnerProduct             605                      1 1 604 606 0=120 1=1 2=57600 9=1
InnerProduct             607                      1 1 606 607 0=480 1=1 2=57600
BinaryOp                 609                      1 1 607 609 0=2 1=1 2=1.200000e+00
HardSigmoid              614                      1 1 609 614 0=1.666667e-01
BinaryOp                 615                      2 1 603_splitncnn_0 614 615 0=2
Convolution              616                      1 1 615 617 0=80 1=1 5=1 6=38400
BinaryOp                 618                      2 1 587_splitncnn_0 617 618
Split                    splitncnn_16             1 2 618 618_splitncnn_0 618_splitncnn_1
Convolution              619                      1 1 618_splitncnn_1 620 0=480 1=1 5=1 6=38400
HardSwish                626                      1 1 620 626 0=1.666667e-01
ConvolutionDepthWise     627                      1 1 626 628 0=480 1=5 4=2 5=1 6=12000 7=480
HardSwish                634                      1 1 628 634 0=1.666667e-01
Split                    splitncnn_17             1 2 634 634_splitncnn_0 634_splitncnn_1
Pooling                  635                      1 1 634_splitncnn_1 635 0=1 4=1
InnerProduct             636                      1 1 635 637 0=120 1=1 2=57600 9=1
InnerProduct             638                      1 1 637 638 0=480 1=1 2=57600
BinaryOp                 640                      1 1 638 640 0=2 1=1 2=1.200000e+00
HardSigmoid              645                      1 1 640 645 0=1.666667e-01
BinaryOp                 646                      2 1 634_splitncnn_0 645 646 0=2
Convolution              647                      1 1 646 648 0=80 1=1 5=1 6=38400
BinaryOp                 649                      2 1 618_splitncnn_0 648 649
Convolution              650                      1 1 649 651 0=480 1=1 5=1 6=38400
HardSwish                657                      1 1 651 657 0=1.666667e-01
Pooling                  658                      1 1 657 658 1=2 2=2 5=1
Permute                  659                      1 1 658 659 0=4
Squeeze                  660                      1 1 659 660 -23300=1,3
LSTM                     722                      1 1 660 722 0=96 1=368640 2=2
InnerProduct             724                      1 1 722 725 0=96 1=1 2=18432
Split                    splitncnn_18             1 2 725 725_splitncnn_0 725_splitncnn_1
Reduction                726                      1 1 725_splitncnn_1 726 0=8 1=0 -23303=1,-1 4=1
Clip                     727                      1 1 726 727 0=1.000000e-12 1=3.402823e+38
BinaryOp                 730                      2 1 725_splitncnn_0 727 730 0=3
InnerProduct             737                      1 1 730 737 0=6922 2=664512
BinaryOp                 output                   1 1 737 output 0=2 1=1 2=3.000000e+01
jinmingyi1998 commented 3 years ago

Environment

ubuntu1804 in docker

ncnn master:

commit 71bc617a05f073d8b623dcc95e88eb5e1eb16aa5 Author: nihui shuizhuyuanluo@126.com Date: Sat May 29 21:43:29 2021 +0800

nihui commented 3 years ago

please provide bin file for reproducing

I tried the crnn model in https://github.com/DayBreak-u/chineseocr_lite/tree/onnx/models_ncnn and it works fine

jinmingyi1998 commented 3 years ago

please provide bin file for reproducing

I tried the crnn model in https://github.com/DayBreak-u/chineseocr_lite/tree/onnx/models_ncnn and it works fine

_crnn.zip

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