Pytorch转NCNN:
1、先将torch模型转成ONNX模型;
2、再讲ONNX模型转成NCNN模型;如果遇到Unsqueeze not supported yet!或Shape not supported yet!问题解决方法:使用ONNX Simplifier 简化模型。
3、pip install onnx-simplifier 完成安装后,执行:python -m onnxsim input_onnx_model output_onnx_model 完成模型简化。
4、ONNX转NCNN,命令:onnx2ncnn.exe xxx.onnx xxx.param xxx.bin;转换工具可直接在NCNN的github上下载。