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)
- Tensorflow Developer certificate didnt recieved yet HOT 1
- TFLite for LSTM: Downscale accumulation from 32-bit to 16-bit before applying to activation HOT 2
- TypeError: len is not well defined for a symbolic Tensor (rnn_decoder_1/gru_1/Squeeze:0). Please call `x.shape` rather than `len(x)` for shape information. HOT 1
- dynamic input shape with InferenceRunner HOT 1
- Trouble Running TensorFlow v2.16.1 with NVIDIA GeForce 940MX GPU #914 HOT 1
- There is no target called wheel HOT 2
- TensorFlow Cuda in Docker under WSL2 not wokring HOT 15
- "CUDA_ERROR_NOT_FOUND: named symbol not found" in Docker container HOT 10
- There was no error when converting the lite model but an error occurred when calling the Interpreter allocate_tensors() method. It will appear if the Conv1D data_format parameter is set to channels_first and the dilation_rate parameter > 1 HOT 2
- Issue with Tesnorflow JS Face Detection on Production HOT 4
- [RNN] LSTM Model conversion error after upgrading to tf 2.16.1 from 2.15 HOT 3
- Training model with the Poisson loss function and the Adam optimizer resulted in NaN loss HOT 2
- Bazel compiling source code failed because of highwayhash/sip_hash.cc HOT 4
- segmentation fault when tf.histogram_fixed_width receives large `value_range` and `nbins` on CPU mode
- Wrong explanation about an argument of tflite interpreter HOT 1
- Not able to build TensorFlow with GPU support HOT 2
- ValueError: `validation_split` is only supported for Tensors or NumPy arrays, found following types in the input: [<class 'int'>] HOT 2
- __add__ with floating point values HOT 1
- TypeError: Expected int32, got 1e-07 of type 'float' instead. HOT 6
- Current tensorflow[and-cuda] installed by pip pulls ptxas which causes Jupyter kernel restart HOT 1
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.