首页 > 其他分享> > onnx转ncnn报错Shape not supported yet! Gather not supported yet # axis=0 Unsupported unsqueeze axes ! U
onnx转ncnn报错Shape not supported yet! Gather not supported yet # axis=0 Unsupported unsqueeze axes ! U
作者:互联网
# 在将pt模型转为onnx之后,将onnx转成ncnn
./onnx2ncnn ~/projects/pytorch-classification/mobilenet.onnx mobilenet.param mobilenet.bin
# 如果网络结构中用到了reshape或者view,可能会报以下错误
Shape not supported yet!
Gather not supported yet!
# axis=0
Unsupported unsqueeze axes !
Unknown data type 0
# pt转换的onnx有很多冗余需要简化
# 可以借助onnx-simplifier
pip install onnx-simplifier
python -m onnxsim mobilenet.onnx mobilenet_sim.onnx
# 然后再在ncnn的环境下执行,就可以成功转换
./onnx2ncnn ~/projects/pytorch-classification/mobilenet_sim.onnx mobilenet.param mobilenet.bin
标签:unsqueeze,mobilenet,onnx,supported,报错,ncnn,yet 来源: https://www.cnblogs.com/liuwenhua/p/16225860.html