Comments (2)
Hi @allogic ,
- Sorry for the delay, Here i am seeing compatibility mismatch. Could you go through this documentation once? Please let us know if issue still persists.
Thank you!
from tensorflow.
Look, I was going through the documentation for a whole week and still could not use tensorflow as a simple static library.
Here is a simple step by step guide to reproduce the behavior I'm experiencing.
NOTE: session_header.lib
is not being built by default. It is only registered in bazel tests, but is not linked into the final binary!
git clone --depth 1 --branch v2.16.1 https://github.com/tensorflow/tensorflow
# ensure "session_header.lib" is being built in //tensorflow/cc/BUILD
python configure.py
set BAZEL_SH="C:\msys64\usr\bin\bash.exe" # Is required for some odd reason...
bazel clean --expunge
It seems clang is the preferred compiler starting with tensorflow 2.16.1. But when building with clang using the following command, clang produces a linker error which I have never encountered. It seems to be a problem on the LLVM site.
NOTE: I've not tested newer versions of clang, only the one described in the documentation!
bazel build --config=win_clang //tensorflow:tensorflow.lib
# time_rep_timespec.obj error LNK2019: unresolved external symbol _Thrd_sleep_for referenced in function "void __cdecl std::this_thread::sleep_for<__int64,struct std::ratio<1,1000000000> >(class std::chrono::duration<__int64,struct std::ratio<1,1000000000> > const &)" (??$sleep_for@_JU?$ratio@$00$0DLJKMKAA@@std@@@this_thread@std@@YAXAEBV?$duration@_JU?$ratio@$00$0DLJKMKAA@@std@@@chrono@1@@Z)
Regardless, when I build with MSVC on the other hand, it works as expected. It generates all the static libraries that I can link against without error.
The monolithic option is described in the .bazelrc
file and is used to create a mostly static build. It also states that it will DISABLE modular op registration which is the problem I am facing currently. All tho it "states" it will be disabled, it does not.
Modular op registration is still enabled and my guess is that all the operators get optimized away during the build to safe binary size.
bazel build --config=monolithic //tensorflow:tensorflow.lib
Last but not least I'm generating the headers.
bazel build //tensorflow:install_headers
Here are all the software versions that I use. They are strictly limited to the versions described in the documentation!
# Tensorflow: 2.16.1
# Python: 3.13.0a6
# LLVM: 17.0.6
# MSVC: 19.39.33520
# Bazel: 6.5.0
I'm forced to leave it like this as I have no proper experience with Bazel and Tensorflow as a whole. But I would be happy if someone could explain to me what I'm missing or doing wrong. It can't be that big of a problem, since the modular op registration has to be disabled somewhere...
from tensorflow.
Related Issues (20)
- Failed to build TF Lite benchmark tool on Windows
- The signatures in SavedModel do not contain serving_default when a subclass of the keras model has multiple inputs HOT 2
- MobileNetV3 quantization HOT 5
- Crash in `tf.raw_ops.ResizeNearestNeighbor/ResizeNearestNeighborGrad/ResizeArea/ResizeBicubic/ResizeBilinear` HOT 3
- Title: TensorFlow/Keras Integration Error: A KerasTensor cannot be used as input to a TensorFlow function HOT 1
- Add stop_evaluating attribute to Model class and add associated modification to evaluate method HOT 1
- Compilation of mlir:tf-opt fails with error "The repository '@llvm_zlib' could not be resolved" HOT 4
- GPU MaxPool gradient ops do not yet have a deterministic XLA implementation HOT 1
- DXGI format does not support cross-API sharing HOT 1
- tflite model maker not install HOT 1
- AttributeError: 'ModelCheckpoint' object has no attribute '_implements_train_batch_hooks' in MoViNet Streaming Model Training HOT 1
- Crash in `tf.raw_ops.SparseCountSparseOutput ` HOT 1
- 16KB so support HOT 1
- Segmentation fault (core dumped) in tf.raw_ops.FractionalMaxPoolGrad when col_pooling_sequence is a very small negative number
- Aborted (core dumped) in `tf.raw_ops.SparseReduceSum\tf.raw_ops.SparseReduceMax` HOT 1
- Aborted (core dumped) in `tf.experimental.numpy.diag/tf.compat.v1.linalg.diag/tf.experimental.numpy.diagflat/tf.keras.ops.diag` HOT 1
- Transfer learning and fine-tuning doc seems to have unexpected results HOT 1
- YOLOv5n model does work on python tflite but not C++ tflite HOT 1
- Selectively Build TensorFlow Lite with Docker ends with an error.
- SparseTensor Batching Utility
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow.