-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Torchscript model to pnnx model error #4598
Comments
|
我按照您的修改方式进行修改:依旧报一样的错误,请问还有什么解决方式吗?谢谢! lizhinan@ml-d3090:~/project/lightse/DTLNPytorch$ pnnx-20220418-ubuntu/pnnx DTLN_aec.pth inputshape=[1,2048],[1,2048],[2,1,512,2],[2,1,512,2]
pnnxparam = DTLN_aec.pnnx.param
pnnxbin = DTLN_aec.pnnx.bin
pnnxpy = DTLN_aec_pnnx.py
ncnnparam = DTLN_aec.ncnn.param
ncnnbin = DTLN_aec.ncnn.bin
ncnnpy = DTLN_aec_ncnn.py
optlevel = 2
device = cpu
inputshape = [1,2048]f32,[1,2048]f32,[2,1,512,2]f32,[2,1,512,2]f32
inputshape2 =
customop =
moduleop =
############# pass_level0
inline module = modules.dtlnModel.NormLayer
inline module = modules.dtlnModel.stftLayer
inline module = modules.dtlnModel_aec_Stateful.seperationOfLSTMs_Stateful_aec
inline module = modules.dtlnModel.NormLayer
inline module = modules.dtlnModel.stftLayer
inline module = modules.dtlnModel_aec_Stateful.seperationOfLSTMs_Stateful_aec
123 40 37 batchsize.1 numSample.1 39 numOfFrames.1 53 audioSegment.1 70 72 74 77 79 82 219 inp.2 y.2 realPart.2 imagPart.2 233 234 235 236 mag_micAudioStft.1 238 463 239 phase_micAudioStft.1 86 87 inp.1 y.1 realPart.1 imagPart.1 255 256 257 258 259 inputs.1 inputs0.1 phase_micAudioStft.3 260 beta.2 gamma.2 meanOfFrames.2 269 270 varianceOfFrames.2 273 stdOfFrames.2 275 outputs.2 outputs0.2 278 279 beta.4 gamma.4 meanOfFrames.4 288 289 varianceOfFrames.4 292 stdOfFrames.4 294 outputs.4 outputs0.4 297 input.1 309 310 311 h1_in.2 313 314 315 c1_in.2 317 318 319 h2_in.2 321 322 323 c2_in.2 hx.2 hx0.2 hx1.2 hx2.2 330 331 332 333 335 336 337 338 339 340 h.2 c.2 346 117 118 magEstimated.1 124 127 out_StftOfStage1.1 out_ifft.1 input0.1 139 inputs1.1 348 beta.6 gamma.6 meanOfFrames.6 357 358 varianceOfFrames.6 361 stdOfFrames.6 363 outputs.6 outputs0.6 366 147 inputs2.1 367 beta.1 gamma.1 meanOfFrames.1 376 377 varianceOfFrames.1 380 stdOfFrames.1 382 outputs.1 outputs0.1 385 input1.1 397 398 399 h1_in.1 401 402 403 c1_in.1 405 406 407 h2_in.1 409 410 411 c2_in.1 hx.1 hx0.1 hx1.1 hx2.1 418 419 420 421 423 424 425 426 427 428 h.1 c.1 434 163 164 out.1 input2.1 173 176 audioDataEnhanced.1 190 196 203
----------------
[W BinaryOps.cpp:601] Warning: floor_divide is deprecated, and will be removed in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values.
To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). (function operator())
foldable_constant gamma.2
foldable_constant beta.1
foldable_constant gamma.1
foldable_constant beta.6
foldable_constant gamma.6
foldable_constant beta.2
foldable_constant beta.4
foldable_constant gamma.4
############# pass_level1
unknown Parameter value kind prim::Constant of TensorType, t.dim = 0
unknown Parameter value kind prim::Constant
no attribute value
no attribute value
unknown Parameter value kind prim::Constant
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
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 NormLayerStage1_mic
assign unique operator name pnnx_unique_1 to NormLayerStage1_ref
assign unique operator name pnnx_unique_2 to seperationStage1.drop
assign unique operator name pnnx_unique_3 to NormLayerStage2_mic
assign unique operator name pnnx_unique_4 to NormLayerStage2_ref
assign unique operator name pnnx_unique_5 to seperationStage2.drop
############# pass_level4
############# pass_level5
make_slice_expression input 2
make_slice_expression input 2
make_slice_expression input 3
make_slice_expression input 3
############# pass_ncnn
Segmentation fault (core dumped) |
模型转换问题比较多,有挺多算子没有支持,ncnn目前也没有支持复数类型
这句导致了crash,没有识别出 1j |
哈哈哈,nihui大大爱了爱了!我以后也要成为你这么牛逼的可爱的人! |
针对onnx模型转换的各种问题,推荐使用最新的pnnx工具转换到ncnn pip install pnnx
pnnx model.onnx inputshape=[1,3,224,224] 详细参考文档 |
error log | 日志或报错信息 | ログ
model | 模型 | モデル
作者大大您好,以上是我的模型,在我初始化后将其导出:
导出想要使用torchscript->pnnx->ncnn最后实现移动端推理,但是在第一步就卡住了,当我执行以下命令时:
报错:
此时会出现debug.bin, debug.param, debug2.bin, debug2.param,DTLN_aec.pnnx.py, DTLN_aec.pnnx.bin, DTLN_aec_pnnx.param等七个文件,下面我给出有关DTLN_aec.pnnx.py的内容:
我注意到可能是我在定义过一个stft层, 是进行短时傅里叶变换的层,可能目前咱的框架不支持? 于是我尝试转成onnx中间表示格式,发现onnx对torch.complex这种数据格式不支持。
我是nihui大大的知乎忠实粉丝,大佬说过:pnnx命名的初衷就是p在o字母后面,表示其会比onnx更好,想请大佬帮忙看下什么问题,是否可以对大大的框架完善有帮助?谢谢大大!
The text was updated successfully, but these errors were encountered: