Closed vahid-nateghi closed 2 years ago
Can you provide your code and signatures of your models to reproduce the errors?
You can also compare your code with the following example whici shows a complex model invoking you mentioned.
https://github.com/serizba/cppflow/tree/master/examples/multi_input_output
Thanks for your quick reply. Actually I could manage to solve the issue but I did not understand why it was the solution. These are the two different ways of calling the model:
auto output = model (input); auto output1 = model ({{"serving_default_input_1:0", input}},{"StatefulPartitionedCall:0"});
Then when I want to use get_data for the first way of calling, I need to say:
std::vector
But when I want to use get_data for the second way of calling, I need to say:
std::vector
It works like that but I do not know why!
It's because you are calling different member functions based on arguments.
The former:
auto output = model (input);
std::vector myvector = output.get_data();
calls the following member function that returns a tensor
.
While the latter
auto output1 = model ({{"serving_default_input_1:0", input}},{"StatefulPartitionedCall:0"});
calls this function that returns a std::vector<tensor>
.
This is the reason you need indexing for the latter case.
I see. Yes, I did not pay attention to the function that is called. Ok then. Thanks for your help. I will close the issue.
Hello, I want to load my model using the Complex Model Call. When I call my model in default mode, I can use get_data() function but when I call my model with specified signature I receive an error as below:
error: ‘class std::vector’ has no member named ‘get_data’
I used the signature that I found using get.operations() function.
Can you help me out here? I need to specify the signature, as I need to load two different models in one script and if I do not specify, for the second one, I receive an error saying there is no operation named "serving_default_input_1" which is reasonable based on the previous closed issues here.
Thanks in advance.