Skip to content

Instantly share code, notes, and snippets.

@Sg4Dylan
Created May 8, 2020 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sg4Dylan/141d64236df8677de668f78673b15c9c to your computer and use it in GitHub Desktop.
Save Sg4Dylan/141d64236df8677de668f78673b15c9c to your computer and use it in GitHub Desktop.
优化 PyTorch 输出 ONNX 模型并转换为 NCNN 模型
@ECHO OFF & CD/D "%~dp0"
::save as CRLF/ANSI format
::usage: drag ONNX model to .bat to start processing
:start
IF "%~1"=="" GOTO :END
:proc
python -m onnxsim "%~nx1" "%~nx1.sim.onnx"
onnx2ncnn.exe "%~nx1".sim.onnx
del "%~nx1".sim.onnx
ncnn2mem.exe ncnn.param ncnn.bin ncnn.id.h ncnn.mem.h
del ncnn.param.bin
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment