Questions tagged [c-api]
154 questions
2
votes
1 answer
Accessing input and output tensors of a tensorflow 2.0 SavedModel via the C API
I am having trouble running inference from a tensorflow 2.0 SavedModel loaded the C_API, because I cannot access the input and output operations by name.
I load the session via TF_LoadSessionFromSavedModel(...) successfully:
#include…

javor
- 21
- 1
- 3
2
votes
0 answers
TensorFlow c++ session shared among forked processes stuck
For CPP integration we use TensorFlow lib from here https://www.tensorflow.org/install/lang_c
As we saw the first TensorFlow session run is time-consuming for our specific model it took 20s and next time it took 200ms.
We strongly limited in time…

user10333
- 331
- 1
- 9
2
votes
0 answers
Tensorflow allocates 4 times more memory in cpu than binary model size
We are using tensorflow C API version 1.13.1
from here https://www.tensorflow.org/install/lang_c
Our neural network model frozen_graph.pb size is 230mb with MobileNet architecture.
When we loading it, tensorflow allocates about 1.1 gb on first…

user10333
- 331
- 1
- 9
2
votes
1 answer
Segmentation fault when use lua coroutine api and lua_close
I am working on a lua script interrupt project, I want to use std::Stack and lua coroutine to save the context. But when I set stacksize to more than 38, it randomly crashes in lua_resume and lua_close.
test.lua:
local stacksize = 40 --When changing…

user8101155
- 45
- 5
2
votes
0 answers
Memory reallocation in TF_SessionRun
I am using TensorFlow with C interface. Documentaion of TF_SessionRun function states: "On success, the tensors corresponding to outputs[0,noutputs-1] are placed in output_values[]. Ownership of the elements of output_values[] is transferred to the…

Michael Burdinov
- 4,348
- 1
- 17
- 28
2
votes
1 answer
Tensorflow c api trace data
I wanted to know how can I get FULL_TRACE Data from Session run using C API Tensorflow.
My problem is I found python example but I don't know how to implement it with C API .
python example :
Run the graph with full trace option
with tf.Session()…

dima
- 51
- 4
2
votes
1 answer
SWIG typedef - Perl array
I have a SWIG file to make many bindings for languages. There is a variable in C source, which is a fixed length list, with integer type. When I'm accessing to that in Perl, that has no items - just shows it's an ARRAY.
Same problem was in Python,…

airween
- 6,203
- 1
- 14
- 20
2
votes
1 answer
How to check if two values in Lua are primitively equal?
When overriding equality operators in Lua (via the "__eq" metamethod), is there a way to still check for primitive equality (ie. not calling the overridden __eq, but checking if the two table values are referentially the same?) I need to do this…

BadZen
- 4,083
- 2
- 25
- 48
2
votes
1 answer
Why do lists have a __reverse__() special method but tuples don't in Python?
The reversed(seq) built-in in Python indicates that seq must have a __reversed__() method or support the sequence protocol. Lists and tuples both obviously support the sequence protocol, but lists have their own __reversed__() method used instead.…

Eric Hansen
- 1,749
- 2
- 19
- 39
2
votes
0 answers
EXEC_BAD_INSTRUCTION (code=1, address=0xe) with MusicSequenceBarBeatTimeToBeats in Swift 2
I have problem when using Apples MusicSequence C API in Swift 2. I can't figure out how to get rid of EXEC_BAD_INSTRUCTION when calling MusicSequenceBarBeatTimeToBeats.
I have tried a lot of different solutions found on internet, but nothing seems…

Gustaf
- 21
- 4
2
votes
1 answer
Excel C API equivalent of Interop Range.Value in C#
Trying to figure out how to read the contents of a reference and get same results and Interop/COM's Range.Value...namely that the object[,] returned contains string, DateTime, and doubles.
I'm using ExcelDNA (and underlying XlCall.Excel to call C…

Terry
- 2,148
- 2
- 32
- 53
2
votes
3 answers
Is there a way to create C library with Cargo?
I need to create a (static) C library that binds to existing crate. Is there any way Cargo can create this C library for me?
I have a crate (e.g. html5ever), and I want Cargo to create a C library based on C-API for that crate.

Daniel Fath
- 16,453
- 7
- 47
- 82
2
votes
1 answer
postgresql jsonb processing with c api
Postgres extension development
I am working with C API for postgres-9.4 installed from ubuntu trusty main repo. This might be a silly question, but please bear with me.
I would like to use a function that converts a cstring to Jsonb* structure…

iggy
- 1,613
- 1
- 18
- 35
2
votes
1 answer
dbus c api example handle timeout case and unref the pending variable
There is a dbus C api example http://www.matthew.ath.cx/misc/dbus . It is also the on github with improvements https://github.com/wware/stuff/blob/master/dbus-example/dbus-example.c . In the query() function which makes a call and gets a reply, do…

minghua
- 5,981
- 6
- 45
- 71
2
votes
2 answers
dbus how to reconnect to a new session bus daemon
As far as I understand it, a dbus user connects to the session bus daemon if the environment defines two variables like:
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-1cAnv4I,guid=3a453c40b5034f
DBUS_SESSION_BUS_PID=102
If the daemon stops and…

minghua
- 5,981
- 6
- 45
- 71