-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: build TensorFlow Lite with Bazel on Windows #4148
Comments
In this commit: - make the -Wno-implicit-fallthrough compiler flag in flatbuffers' BUILD file be conditional to non-Windows builds, because MSVC doesn't know this flag - fix the Bazel build command in README.md by removing single quotes around --cxxflags, because it's not needed on Bash and is harmful on Windows (because cmd.exe doesn't remove the single quotes) - fix non-ASCII quotes and apostrophes, as well as some formatting issues in README.md See bazelbuild/bazel#4148
Bazel cannot yet build TensorFlow Lite on Windows, but this commit gets us closer. In this commit: - make the -Wno-implicit-fallthrough compiler flag in flatbuffers' BUILD file be conditional to non-Windows builds, because MSVC doesn't know this flag - fix the Bazel build command in README.md by removing single quotes around --cxxflags, because it's not needed on Bash and is harmful on Windows (because cmd.exe doesn't remove the single quotes) - fix non-ASCII quotes and apostrophes, as well as some formatting issues in README.md See bazelbuild/bazel#4148
Bazel cannot yet build TensorFlow Lite on Windows, but this commit gets us closer. In this commit: - make the -Wno-implicit-fallthrough compiler flag in flatbuffers' BUILD file be conditional to non-Windows builds, because MSVC doesn't know this flag - fix the Bazel build command in README.md by removing single quotes around --cxxflags, because it's not needed on Bash and is harmful on Windows (because cmd.exe doesn't remove the single quotes) - fix non-ASCII quotes and apostrophes, as well as some formatting issues in README.md See bazelbuild/bazel#4148
Bazel cannot yet build TensorFlow Lite on Windows, but this commit gets us closer. In this commit: - make the -Wno-implicit-fallthrough compiler flag in flatbuffers' BUILD file be conditional to non-Windows builds, because MSVC doesn't know this flag - fix the Bazel build command in README.md by removing single quotes around --cxxflags, because it's not needed on Bash and is harmful on Windows (because cmd.exe doesn't remove the single quotes) - fix non-ASCII quotes and apostrophes, as well as some formatting issues in README.md See bazelbuild/bazel#4148
/cc: @meteorcloudy |
Raising to P1. I want to do this in Q1-2018. |
Bazel cannot yet build TensorFlow Lite on Windows, but this commit gets us closer. In this commit: - make the -Wno-implicit-fallthrough compiler flag in flatbuffers' BUILD file be conditional to non-Windows builds, because MSVC doesn't know this flag - fix the Bazel build command in README.md by removing single quotes around --cxxflags, because it's not needed on Bash and is harmful on Windows (because cmd.exe doesn't remove the single quotes) - fix non-ASCII quotes and apostrophes, as well as some formatting issues in README.md See bazelbuild/bazel#4148
Update: I'm not actively working on this, unfortunately. I'm focused on #4460, #4292, and #4319. Maybe P1 is appropriate but I cannot seem to deliver that. @meteorcloudy , @dslomov : WDYT about dropping the priority? If you think it's still P1, how do you think we could find time for this? |
I think we can drop the priority to P2. I talked to people working on TensorFlow lite, they don't seem to need this urgently. We can reconsider the priority after TF completely moves to Bazel on Windows, which is what I'm working on right now. |
resource_extractor needs PATH to be set on Windows, otherwise it throws: Traceback (most recent call last): File "C:\Program Files\Anaconda3\lib\site.py", line 570, in <module> main() File "C:\Program Files\Anaconda3\lib\site.py", line 561, in main os.environ["PATH"]) File "C:\Program Files\Anaconda3\lib\os.py", line 725, in __getitem__ raise KeyError(key) from None KeyError: 'PATH' Target //tensorflow/contrib/lite/examples/android:tflite_demo failed to build Working towards: #4148 RELNOTES: None. PiperOrigin-RevId: 211324206
I tried building TFLite at tensorflow/tensorflow@3e21fe5, using Bazel 0.22.0 (configure.py complains if you use 0.23.0), with Python3 on my PATH, on Windows 10. It fails with both MSVC and with GCC, but it gets pretty far: With MSVC:
Apparently something tries to include With GCC:
|
https://www.tensorflow.org/lite/demo_android#build_tensorflow_lite_and_the_demo_app_from_source
|
The Android Demo consistently crashes for me (both with Bazel 0.22.0 and 0.23.0):
My envvars:
|
I finally figured out why. Looks like for TensorFlow Lite we should not run the Can you re-try after deleting Update:
|
Yes, that works around the crash, thank you! The build now succeeds, though some actions print what look like errors:
|
That is an android error message. Adding @ahumesky, @jin in case what I'm about to say is wrong or if they have something more to add :) The error message gets thrown here: bazel/src/tools/android/java/com/google/devtools/build/android/UnwrittenMergedAndroidData.java Line 151 in a1f2ddb
(also see: bazel/src/tools/android/java/com/google/devtools/build/android/MergeConflict.java Line 31 in a1f2ddb
IIRC, assets are one form of data that your android app might use. You can provide multiple asset roots (directories), and then bazel will attempt to merge the assets from the roots for you. If there are conflicts, bazel will just pick one of them and keep going, but you will get warnings like the one you're seeing. The WORKSPACE file is not an asset that is useful to an android app. So my guess is that tensorflow has (at least) two asset roots which contain useful assets, but which also contain a WORKSPACE file. This is triggering the warning. But the warning is almost certainly safe to ignore because I doubt the app is actually using either of the WORKSPACE files. However, if this is true, I do not have a suggestion for how to disable the warning. Question: did you make a change that recently started triggering these warnings? |
@dkelmer is correct. It's very likely that the WORKSPACE files are accidentally over-globbed into the |
Thank you! @dkelmer :
Who are you asking? If me: I haven't; the code belongs to TensorFlow. |
@meteorcloudy what's the status here? |
This is obsolete. TFLite should already be tested on TF CI |
Bazel cannot yet build TensorFlow Lite on Windows, but this commit gets us closer. In this commit: - make the -Wno-implicit-fallthrough compiler flag in flatbuffers' BUILD file be conditional to non-Windows builds, because MSVC doesn't know this flag - fix the Bazel build command in README.md by removing single quotes around --cxxflags, because it's not needed on Bash and is harmful on Windows (because cmd.exe doesn't remove the single quotes) - fix non-ASCII quotes and apostrophes, as well as some formatting issues in README.md See bazelbuild/bazel#4148
resource_extractor needs PATH to be set on Windows, otherwise it throws: Traceback (most recent call last): File "C:\Program Files\Anaconda3\lib\site.py", line 570, in <module> main() File "C:\Program Files\Anaconda3\lib\site.py", line 561, in main os.environ["PATH"]) File "C:\Program Files\Anaconda3\lib\os.py", line 725, in __getitem__ raise KeyError(key) from None KeyError: 'PATH' Target //tensorflow/contrib/lite/examples/android:tflite_demo failed to build Working towards: bazelbuild/bazel#4148 RELNOTES: None. PiperOrigin-RevId: 211324206
This is a tracking bug for building TF Lite on Windows with Bazel.
@tensorflow//third_party/flatbuffers/flatbuffers.BUILD
<reponame>/external/bazel_tools
(must test on Android BusyBox)src/main/native/windows/BUILD.tools
src/main/native/windows/*.{cc,h}
to//src/main/native/windows:embedded_tools
--nocompress_suffixes
, and some build rule requires that --> migrate to C++ SingleJar on Windows (Use the new singlejar on Windows #2241)The text was updated successfully, but these errors were encountered: