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

PNNX模型转化报错,未生成ncnn模型 #3969

Open ChaoII opened 2 years ago

ChaoII commented 2 years ago

总体通过,但是最后报错,导致未生成ncnn的模型。

############# pass_level0
inline module = pytorchocr.modeling.backbones.rec_mv1_enhance.ConvBNLayer
inline module = pytorchocr.modeling.backbones.rec_mv1_enhance.DepthwiseSeparable
inline module = pytorchocr.modeling.backbones.rec_mv1_enhance.MobileNetV1Enhance
inline module = pytorchocr.modeling.backbones.rec_mv1_enhance.SEModule
inline module = pytorchocr.modeling.backbones.rec_svtrnet.Attention
inline module = pytorchocr.modeling.backbones.rec_svtrnet.Block
inline module = pytorchocr.modeling.backbones.rec_svtrnet.ConvBNLayer
inline module = pytorchocr.modeling.backbones.rec_svtrnet.Identity
inline module = pytorchocr.modeling.backbones.rec_svtrnet.Mlp
inline module = pytorchocr.modeling.common.Activation
inline module = pytorchocr.modeling.common.Hswish
inline module = pytorchocr.modeling.common.Swish
inline module = pytorchocr.modeling.heads.rec_ctc_head.CTCHead
inline module = pytorchocr.modeling.necks.rnn.EncoderWithSVTR
inline module = pytorchocr.modeling.necks.rnn.Im2Seq
inline module = pytorchocr.modeling.necks.rnn.SequenceEncoder
############# pass_level1
no attribute value
no attribute value
no attribute value
no attribute value
no attribute value
no attribute value
no attribute value
no attribute value
no attribute value
############# pass_level2
############# pass_level3
assign unique operator name pnnx_unique_0 to neck.encoder.svtr_block.0.mlp.drop
assign unique operator name pnnx_unique_1 to neck.encoder.svtr_block.1.mlp.drop
############# pass_level4
############# pass_level5
############# pass_ncnn
libc++abi: terminating with uncaught exception of type std::out_of_range: map::at:  key not found
[1]    58613 abort      ./pnnx ch_ptocr_v3_rec_infer.pt

此外pnnx模型中存在aten::mul_算子。pt模型文件如下: model.pt.zip 请大佬们帮忙看看,啥情况。

nihui commented 2 years ago

https://github.com/Tencent/ncnn/pull/3970

nihui commented 2 years ago

这个模型里存在着手写的 multiheadattention,暂时无法合并,建议改为标准的 nn.MultiheadAttention 实现