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
{{ message }}
Repository navigation
libprotobuf map.h error when running universal sentence encoder #253
#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.
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.
Activity
JZacaroli commentedon Nov 23, 2023
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.