-
Notifications
You must be signed in to change notification settings - Fork 74k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C/Other Languages: Support serialization and deserialization of Tensors #6003
Comments
The current implementation has limitations, in particular it does not support string tensors. But the same API will be sufficient when that limitation has been addressed. See also tensorflow#6003. The API added here can be used to fill in the tensor_contents field of a TensorProto protocol buffer. Change: 140760816
@asimshankar, saw "Go: API functions to serialize/deserialize Tensors" was added with #6137. Are we expecting further update on this issue? |
Nobody is actively working on this, this was more of a tracking bug. I think it's fine to close this for now (and re-open if and when the need is more urgent). The "need" would be to save/load tensors directly (as opposed to using things like the Restore operations or a SavedModel loader). |
@asimshankar, could we reopen this? Tensor se/de operations in C would be extremely useful for multi-language interoperability. |
@sbsends : Happy to reopen it, but would love to hear what specifically you're interested in. Could you elaborate on what you're trying to do and the problems being run into? |
@asimshankar, we are interested in passing TensorProto's directly between languages. E.g. generating a packed TensorProto in Python and sending them over the wire to a program running in Golang. This is possible using Pythons implementation of make_proto and then building a custom handler in Golang to parse the TensorProto's contents/type/dim's. The tensor contents can be read using ReadTensor, but this only supports numeric data types. IMHO, it would be significantly cleaner (and less error prone) to handle ser/de in a standardized way across all client libraries using the C API. Edit: grammar fix |
@asimshankar, would you consider giving feedback on our stab at building a standard for transporting tensors across applications/languages? The goal is to support many frameworks and act as an intermediary between application specific protocols. What can we do to increase the likelihood of gaining TensorFlow support? |
@asimshankar Would it we possible to reopen this? In our case, we would like to serialize/deserialize tensors to communicate with Tensorflow Serving from Go. We can not use the Go library as it does not handle serialization of string tensors. |
Seconding the above comment -- I ran into this issue trying to use to Go API In the meantime is there an easy workaround for parsing string |
In C++ and Python, Tensors can be serialized into a
TensorProto
using functions likeTensor::AsProtoTensorContents
andmake_tensor_proto
This is particularly useful when communicating tensors across process boundaries such as PredictRequest RPCs to a TensorFlow Model Server
Filing this to track any changes to the C API and language bindings.
Interested parties: @asimshankar @jhseu @nfiedel @josh11b
The text was updated successfully, but these errors were encountered: