Last active
January 17, 2022 10:34
-
-
Save iwatake2222/3017d9ac3112b27cc9f5011ece993009 to your computer and use it in GitHub Desktop.
How to generate tensorflowlite.dll for Visual Studio (Windows)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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) |
It's weird, the lib file should be generated automatically.
Did you use the same commit id as my sample? If not, the build script might changed.By the way, you can actually create the lib file from DLL using
dumpbin
andlib
commands in Developer Command Prompt for VS 20xx.
- The same commit id was used in my trial.
- The tip of creating lib from dll is so helpful.
Thanks a lot, iwatake!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's weird, the lib file should be generated automatically.
Did you use the same commit id as my sample? If not, the build script might changed.
By the way, you can actually create the lib file from DLL using
dumpbin
andlib
commands in Developer Command Prompt for VS 20xx.