Skip to content

Not able to create a vector of DT_STRING #196

@ns-wxin

Description

@ns-wxin

Hi,

My model looks like following:

signature_def['serving_default']:
    The given SavedModel SignatureDef contains the following input(s):
      inputs['sentences'] tensor_info:
          dtype: DT_STRING
          shape: (-1)
          name: serving_default_sentences:0
    The given SavedModel SignatureDef contains the following output(s):
      outputs['output_0'] tensor_info:
          dtype: DT_FLOAT
          shape: (-1, 50)
          name: StatefulPartitionedCall_2:0
    Method name is: tensorflow/serving/predict

It's an array of DT_STRING for input. I'm not able to use your interface to build input tensor. There's only one interface that takes a single std::string. No interface takes a vector of std::string. The following code would not work. Please advise.

string sent1 {"I enjoy taking long walks along the beach with my dog."};
auto sentence = cppflow::tensor(sent1);
cppflow::model model(modelPath);
auto output = model({{"serving_default_sentences:0", sentence}},{"StatefulPartitionedCall_2:0"});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions