You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include <iostream>
#include <tensorflow/c/c_api.h>
#include <cppflow/cppflow.h>
int main() {
printf("Hello from TensorFlow C library version %s\n", TF_Version());
cppflow::model model("model-use");
auto input = cppflow::reshape(cppflow::tensor(std::string("hello")), {-1});
std::cout << input << std::endl;
auto output_tensor = model({{"serving_default_inputs:0", input}},{"StatefulPartitionedCall_1:0"}); // <-- Line causing the error
return 0;
}
This is the output of the saved_model_cli command on the saved model .pb file:
The given SavedModel SignatureDef contains the following input(s):
inputs['inputs'] tensor_info:
dtype: DT_STRING
shape: (-1)
name: serving_default_inputs:0
The given SavedModel SignatureDef contains the following output(s):
outputs['outputs'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 512)
name: StatefulPartitionedCall_1:0
Method name is: tensorflow/serving/predict
If I change "serving_default_inputs:0" to "serving_default_inputs" and "StatefulPartitionedCall_1:0" to "StatefulPartitionedCall" when calling the model, then it doesn't fail, and instead returns this: (tensor: shape=[], dtype=TF_FLOAT, data=1). I am hoping to get a 512 dimensional vector out of it.
Any help is very much appreciated!
The text was updated successfully, but these errors were encountered:
I've managed to get this working by using tensorflow v2.10, instead of v2.15. Not sure why this works though..
The tensorflow download page mentions v2.10 being the latest version that's supported GPU on windows, but just I'm using the CPU version.
Doesn't seem like an issue with cppflow, but I'll leave this up in case someone can explain what the protobuf error is about.
I'm trying to embed a string using the universal sentence encoder, but I'm hitting this error when running the model:
I'm compiling like so (using windows):
This is hello_tf.cpp:
This is the output of the saved_model_cli command on the saved model .pb file:
If I change "serving_default_inputs:0" to "serving_default_inputs" and "StatefulPartitionedCall_1:0" to "StatefulPartitionedCall" when calling the model, then it doesn't fail, and instead returns this:
(tensor: shape=[], dtype=TF_FLOAT, data=1)
. I am hoping to get a 512 dimensional vector out of it.Any help is very much appreciated!
The text was updated successfully, but these errors were encountered: