Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Pandinosaurus/68a9aa01d701f13f7c91b3b7d1885581 to your computer and use it in GitHub Desktop.

Select an option

Save Pandinosaurus/68a9aa01d701f13f7c91b3b7d1885581 to your computer and use it in GitHub Desktop.
How to generate tensorflowlite.dll for Visual Studio (Windows)
# On Git Bash
cd path-to-tensorflow
git checkout 00cb358ab2e67d0b06a21901ded13c57fd47e673
./tensorflow/lite/tools/make/download_dependencies.sh
nano tensorflow/lite/build_def.bzl
###
# --- a/tensorflow/lite/build_def.bzl
# +++ b/tensorflow/lite/build_def.bzl
# @@ -159,6 +159,7 @@ def tflite_cc_shared_object(
# tf_cc_shared_object(
# name = name,
# copts = copts,
# + features = ["windows_export_all_symbols"],
# linkstatic = linkstatic,
# linkopts = linkopts + tflite_jni_linkopts(),
# framework_so = [],
###
# On Anaconda Powershell prompt (Miniconda3)
conda create -n build_tflite
conda activate build_tflite
conda install python
conda install numpy
cd path-to-tensorflow
python configure.py
bazel build -c opt //tensorflow/lite:tensorflowlite
ls ./bazel-bin/tensorflow/lite/tensorflowlite.dll
- Windows 10
- Visual Studio 2017
- Bazel
- bazel-1.2.1-windows-x86_64.zip
- Add path to bazel.exe
- Python 3.8.1 (on Miniconda)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment