How to Checkout OnnxRuntime for Building from Source on Windows

Tech Notes
Dec 20, 2021

--

If I just download the zip from the Release page and then follow the build instructions, I get this error:

subprocess.CalledProcessError: Command ‘[‘git’, ‘submodule’, ‘sync’, ‘ — recursive’]’ returned non-zero exit status 128.

You can’t just build from the latest on master branch, you need to checkout a tag for a release and build from that. Master could have anything in it, and it is not guaranteed to work. This is not explicitly stated in their documentation.

Do this instead:

git clone https://github.com/microsoft/onnxruntime.git
cd onnxruntime
git tag -l
### This will show you all the available release tags
# prolly will look something like this:
ls
orttraining_rc2
v0.1.4
v0.1.5
v0.2.1
v0.3.0
v0.3.1
v0.4.0
v0.5.0
v0.5.1
v1.0.0
v1.1.0
v1.1.1
v1.1.2
v1.2.0
v1.3.0
v1.3.1
v1.4.0
# Now to git checkout tags/vx.x.x
git checkout tags/v1.4.0

--

--