Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

Model accuracy(inference) is almost zero for resnet50 using tensorflow cpp api

I am using tensorflow cpp api to do inference for imagenet 2012 validation dataset using resnet50 model. I have saved the pre-trained model(on resnet50) using model=tf.keras.applications.ResNet50(...
Parveen Duhan's user avatar
0 votes
0 answers
26 views

Tensorflow C++ Tensor.SubSlice(1)

I am coding my own neural network with tensorflow c++ api. I have a tensor with all data with shape [65000, 784] and reshaped it to tensor with shape [2031, 32, 784] to use it as batches. To use the ...
SknG's user avatar
  • 1
1 vote
0 answers
60 views

How to install Tensorflow for C dependency on docker in linux

I am new to Docker and I am trying to install Tensorflow for C since a package I am trying to run requires the dependency #include <tensorflow/c/c_api.h>. I am not sure about what to add to the ...
Circa Dramatic's user avatar
0 votes
0 answers
250 views

Passing an array of arrays to a input tensor

I'm working into breaking an image(540x360) to 60x60 matrix referred by cv::Mat imga in my code, then normalizing in cv::Mat imga_normalized and finally passing each 60x60 normalized to a std::vector&...
mentejoao's user avatar
0 votes
1 answer
311 views

Is there an equivalent of tf.gradients function in tensorflow C or C++ API?

I want to implement a tensorflows function tf.gradients in C or C++ API? Tensorflow C++ has the worst documentation in the world and C API aren't documented at all. Can you suggest if there is an ...
user2426998's user avatar
2 votes
1 answer
1k views

Has anyone experience in building a static library for the Tensorflow C++ API?

I need to build Tensorflow as a static library to include into a product. As of now it seems that there's only support for building a shared/dynamic library with bazel. My current objective is to ...
Maxxxxxx's user avatar
0 votes
1 answer
286 views

How to make CMakeLists.txt files for LibTensorFlow

I wonder how to make CMakeLists.txt files for Install TensorFlow for C. I can build the C++ file (i.e. ./app/main.cpp) with g++, but it is difficult to build the same C++ file with CMake file. Please ...
Vujadeyoon's user avatar
0 votes
2 answers
468 views

How to create custom tensor value with shape (b,n,m)?

How to create custom tensor value with shape (b,n,m) I see the cppflow::fill method but it allows inserting 1 value which fills the whole same value in the shape I see https://github.com/serizba/...
Alfan Rizaldy's user avatar
1 vote
1 answer
325 views

How to run Yolov5 tensorflow model.pb inside c++ code?

I have trained a model using yolov5 and I got the model.pt I convert it using the export file to TensorFlow compatible model.pb now I want to use this model with c++ instead of python I did a lot of ...
M.Akyuzlu's user avatar
  • 325
2 votes
1 answer
421 views

Loading TensorFlow model to manipulate an audio stream with C++

I want to load a machine learning model created with TensorFlow into my C++ Audio Application made with JUCE6. In order to use TensorFlow inside C++, I am using the TensorFlow wrapper CppFlow. I have ...
Raphael's user avatar
  • 33
1 vote
1 answer
609 views

Immediate runtime error with Tensorflow C api on M1 Mac

I am trying to use the Tensorflow C api in an xcode project. As soon as the app starts running a BAD_INSTRUCTION error is generated on the main thread. This error comes from: tensorflow::monitoring::...
WalleyM's user avatar
  • 172
0 votes
2 answers
735 views

How do I write CMakeList.txt file to include the tensorflow library? (c++ build)

I have succeeded build tensorflow(v1.14.0) c++ with bazel. And I can build tensorflow library with g++. I want to include other libraries (eg json) in this code. So I want to know how to build the ...
김기훈's user avatar
0 votes
1 answer
146 views

Loading Tensorflow saved models using the C Api version2.3

I have a .pb model file generated by python TF V2.3. When I am trying to load it using the C api it throws the error what(): Invalid GraphDef. Does the current C/Cpp api support loading of models ...
Kyrokar's user avatar
3 votes
1 answer
882 views

TensorFlow C API Logging Setting

I am trying to suppress the logging of the tensorflow in C-API when it loads a saved model. The logging looks like this 2020-07-24 13:06:39.805191: I tensorflow/cc/saved_model/reader.cc:31] Reading ...
philgun's user avatar
  • 189
0 votes
2 answers
629 views

How can I run Tensorflow on one single core, single thread CPP?

I am trying to restrict the number of threads that TensorFlow spawns. In python, I understand we need to use the following steps as pointed out Here. I was trying to do the same in CPP, but it doesn't ...
amit pandey's user avatar
4 votes
2 answers
3k views

Tensorflow C API Selecting GPU

I am using the Tensorflow C API to run models saved/frozen in python. We use to run these models on CPU but recently switched to GPU for performance. To interact with the C API we use a wrapper ...
afaq's user avatar
  • 65
2 votes
1 answer
1k views

TF_NewTensor Segmentation Fault: Possible Bug?

I'm using Tensorflow 2.1 git master branch (commit id:db8a74a737cc735bb2a4800731d21f2de6d04961) and compile it locally. Playing around with the C API to call TF_LoadSessionFromSavedModel but seems to ...
AmirulOm's user avatar
  • 113
0 votes
1 answer
542 views

Tensorflow in C++: Successfully reading the protocol buffer for LSTM encoder decoder model

I have been debugging this issue for a while now. I have developed an LSTM encoder decoder model which I plan to deploy in C++. Having saved the model in the .pb file format, I am able to import the ...
Narayan Narvekar's user avatar
0 votes
1 answer
55 views

Tensorflow c++ windows bazel build giving error while reading extensions file

hey guys im trying to install tensorflow c++ on windows 10 but im running into this issue when i try to do the bazel command bazel build --config=opt //tensorflow/tools/pip_package:...
gtx's user avatar
  • 113
1 vote
1 answer
182 views

Can tensorflow consume GPU memory exactly equal to required

I use tensorflow c++ version to do CNN inference. I already set_allow_growth(true), but it still consume more GPU memory than exactly need . set_per_process_gpu_memory_fraction can only set an upper ...
Samuel's user avatar
  • 6,227