Looking for tflearn and Tensorflow examples in C

1,993 views
Skip to first unread message

ssarkaray...@gmail.com

unread,
Jun 24, 2017, 8:42:35 PM6/24/17
to Discuss

Hello,

I could only locate examples in python for tflearn and TensorFlow.  I am curious if there are tflearn + tensorflow examples in C and C++.
Please help me find some example applications in C and C++.

Thanks,
S. Sarkar

Martin Wicke

unread,
Jun 24, 2017, 10:24:06 PM6/24/17
to ssarkaray...@gmail.com, Discuss
The higher level libraries are python only, at least for now. Inference can be done in C++ alone using tensorflow/serving. Everything else can also be done, but you'll need to use the lower level APIs. 

--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/5676a117-11c1-4e02-87e3-a602468eacca%40tensorflow.org.

haiy

unread,
Jun 24, 2017, 11:32:28 PM6/24/17
to Discuss
according to the official api doc here,https://www.tensorflow.org/api_docs/,

the APIs in languages other than Python are not yet covered by the API stability promises"

so, "some example applications" could be just demo like ,you may need to use the c/c++ carefully, cause some ops  maybe not implemented yet.
"
tensorflow/tensorflow/cc/tutorials/example_trainer.cc


在 2017年6月25日星期日 UTC+8上午8:42:35,ssarkaray...@gmail.com写道:

ssarkaray...@gmail.com

unread,
Jun 25, 2017, 2:41:44 PM6/25/17
to Discuss
So I found following API guide and  C_api.h (on Github):

https://www.tensorflow.org/api_guides/cc/guide

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/c/c_api.h

No API stability promises yet ! 

Can we call Python API from C and C++ for now ?  ( https://docs.python.org/2.0/ext/callingPython.html )

Martin Wicke

unread,
Jun 25, 2017, 2:51:19 PM6/25/17
to ssarkaray...@gmail.com, Discuss
You can call python from C/C++, but it's unclear to me what the advantage of that would be. 

--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.

haiy

unread,
Jun 25, 2017, 10:48:43 PM6/25/17
to Discuss
yes, we can,the official way to call c/c++ api is through generated python lib code by swig.You can find the swig config file in the source code like 
"tensorflow/python/client/tf_session.i".
But do you actually need to do this? It's quite expensive 


在 2017年6月26日星期一 UTC+8上午2:41:44,ssarkaray...@gmail.com写道:

ssarkaray...@gmail.com

unread,
Jun 28, 2017, 2:28:46 AM6/28/17
to Discuss
Is it possible to query a hidden layer or output layer in a neural network ?  Are there APIs to fetch all data and metadata associated with any hidden layer ?

Martin Wicke

unread,
Jun 28, 2017, 3:46:02 AM6/28/17
to ssarkaray...@gmail.com, Discuss
Using the object-oriented layers (either in tf.layers or tf.contrib.keras) you can query any output by specifying it as a fetch in a session.run call.

--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
Reply all
Reply to author
Forward
0 new messages