Open ysyyun opened 3 years ago
This may be helpful for you - Conversion instruction for YOLOX: https://github.com/Megvii-BaseDetection/YOLOX/tree/main/demo/ncnn/cpp.
针对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
error log | 日志或报错信息 | ログ
Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes !
model | 模型 | モデル
how to reproduce | 复现步骤 | 再現方法
1.mac环境,编译ncnn
-- CMAKE_INSTALL_PREFIX = /Users/yunyang/Downloads/learn/ncnn/build/install -- NCNN_VERSION_STRING = 1.0.21.08.30 -- Target arch: x86 -- Found OpenMP_C: -Xclang -fopenmp (found version "5.0") -- Found OpenMP_CXX: -Xclang -fopenmp (found version "5.0") -- Found OpenMP: TRUE (found version "5.0")
-- OpenCV library: /usr/local/Cellar/opencv/4.5.3_2 -- version: 4.5.3 -- libraries: opencv_core;opencv_highgui;opencv_imgproc;opencv_imgcodecs;opencv_videoio -- include path: /usr/local/Cellar/opencv/4.5.3_2/include/opencv4 -- Configuring done -- Generating done -- Build files have been written to: /Users/yunyang/Downloads/learn/ncnn/build
2.转yolov5s.pt位onnx,python3 export.py --weights yolov5s.pt --img 640 --batch 1 3.python3 -m onnxsim yolov5s.onnx yolov5s-sim.onnx得到yolov5s-sim.onnx 4../onnx2ncnn yolov5s-sim.onnx yolov5s.param yolov5s.bin,出现 Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes ! Unsupported slice axes !
请问有遇到这个问题吗?这个是什么原因,如何处理?谢谢