Tensorflow 2.16.1 for c++ on win 11

Hi,
I have already trained a LSTM model in python using tensorflow/keras. The model prediction speed are lower than required. So, I want to deploy the model in C++ to speed up the real time prediction.
I have followed the guide to build tensorflow form source on windows. Then, I defined the include directory for header files in visual studio but I don’t know what should I do about libraries and .dll. I mean I don’t know which .lib I have to define to visual studio and also I did not find any .dll file.

Tensorflow 2.16.1
Visual studio 2019

1 Like

Actually, if you’re trying to build Tensorflow in Windows for using the C++ API, you probably have to build these specific targets in your bazel build command for building the DLL file and also generating an import library (*.lib) file.

But the problem with the generated DLL file is that, some symbols may be missing in the final DLL file, due to there being a limit on how many symbols can be stored in a DLL file, which is I believe, 65535 symbols. We may have to use TF_EXPORT to export specific Class/Methods that we might need explicitly.

bazelisk build --config=opt //tensorflow:tensorflow.dll //tensorflow:tensorflow.lib //tensorflow:install_headers