Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnnx pass_ncnn 崩溃 #4381

Closed
zuowanbushiwo opened this issue Nov 30, 2022 · 2 comments
Closed

pnnx pass_ncnn 崩溃 #4381

zuowanbushiwo opened this issue Nov 30, 2022 · 2 comments

Comments

@zuowanbushiwo
Copy link

zuowanbushiwo commented Nov 30, 2022

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

pnnxparam = dcrn_stft.pnnx.param
pnnxbin = dcrn_stft.pnnx.bin
pnnxpy = dcrn_stft_pnnx.py
pnnxonnx = dcrn_stft.pnnx.onnx
ncnnparam = dcrn_stft.ncnn.param
ncnnbin = dcrn_stft.ncnn.bin
ncnnpy = dcrn_stft_ncnn.py
fp16 = 1
optlevel = 2
device = cpu
inputshape = [1,257]f32,[1,257]f32,[2,1,128]f32,[1,9728]f32,[1,19456]f32
inputshape2 =
customop =
moduleop =
############# pass_level0
inline module = CausalConvBlock
inline module = CausalTransConvBlock
inline module = CausalTransConvBlockEnd
inline module = CausalConvBlock
inline module = CausalTransConvBlock
inline module = CausalTransConvBlockEnd

----------------

############# pass_level1
no attribute value
swapped detected !
no attribute value
############# pass_level2
############# pass_level3
############# pass_level4
############# pass_level5
make_slice_expression input 3
make_slice_expression input 10
make_slice_expression input 3
make_slice_expression input 3
make_slice_expression input 3
make_slice_expression input 3
make_slice_expression input 3
make_slice_expression input 4
make_slice_expression input 4
make_slice_expression input 4
make_slice_expression input 4
make_slice_expression input 4
make_slice_expression input 4
############# pass_ncnn
Segmentation fault (core dumped)

model | 模型 | モデル

  1. original model
    Pytorch 模型

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

  1. os.system("~/pnnx-20221116-ubuntu/pnnx dcrn_stft.pt inputshape=[1,257],[1,257],[2,1,128],[1,9728],[1,19456]")
  2. 能生成pnnx 相关的文件,使用dcrn_stft_pnnx.py 推理也能得到正确的结果。
  3. ncnn 转换失败,ncnn相关的文件没有。
    @nihui 大佬帮看看一下 这个模型可以用ncnn 推理吗
@nihui
Copy link
Member

nihui commented Aug 5, 2024

针对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

@nihui
Copy link
Member

nihui commented Nov 19, 2024

#5779

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants