我的模型结构中使用到了torch.split对channel进行切割,转换到onnx没有问题,但是通过onnx转换到ncnn出错,请问split操作是支持的嘛?或者有什么办法可以替换这个操作?
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
Most helpful comment
@soham24 You may be able to try the following https://github.com/biubug6/ncnn_faceboxes/tree/master/tools/onnx