Ncnn: pytorch转onnx之后再转ncnn: Split not supported yet! # axis=1 # split=7

Created on 13 Apr 2019  ·  7Comments  ·  Source: Tencent/ncnn

我的模型结构中使用到了torch.split对channel进行切割,转换到onnx没有问题,但是通过onnx转换到ncnn出错,请问split操作是支持的嘛?或者有什么办法可以替换这个操作?

Most helpful comment

@soham24 You may be able to try the following https://github.com/biubug6/ncnn_faceboxes/tree/master/tools/onnx

All 7 comments

ncnn 中split操作是整个blob复制,没有做channel切割,真正做channel切割的是slice层,但不支持onnx::split 到 ncnn::slice的转换,可以pytorch > caffe > ncnn ,或者改写onnx2ncnn.cpp 添加split to slice操作,我改了一版但是slice层好像有bug ,一到这层就崩

了解,我看看w

@nihui @hanfanggithub 请问这个问题有解决方案了嘛

@hanfanggithub I am stuck at the same problem.
@nihui overriding split to slice is buggy. Can we expect a proper split operation in onnxtoncnn
or any work around?

@hanfanggithub did you found solution to this?

@soham24 You may be able to try the following https://github.com/biubug6/ncnn_faceboxes/tree/master/tools/onnx

https://github.com/Tencent/ncnn/commit/1b910efea52621e36813874334d18920c48ec6d4
slice op should be converted to ncnn crop properly now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlexeyAB picture AlexeyAB  ·  3Comments

SisterL picture SisterL  ·  3Comments

baiyecha picture baiyecha  ·  3Comments

yizhaoyanbo picture yizhaoyanbo  ·  3Comments

xhappy picture xhappy  ·  5Comments