我有一个以字符串参数作为输入的tensorflow模型。在Triton Java api中使用什么类型的字符串?
例如:模型定义
{
"name":"test_model", "platform":"tensorflow_savedmodel", "backend":"tensorflow",
"version_policy":{
"latest":{
"num_versions":1
}
},
"max_batch_size":8,
"input":[{
"name":"input_text", "data_type":"TYPE_STRING", "format":"FORMAT_NONE", "dims":[1],"reshape":{
"shape":[]},"is_shape_tensor":false, "allow_ragged_batch":false
}]客户端代码
String text = "the text";
InferTensorContents.Builder input0_data = InferTensorContents.newBuilder();
input0_data ... how to set发布于 2021-03-12 01:10:26
Triton使用google协议,所以这就是他们使用ByteString的方式
String text = "textstring";
InferTensorContents.Builder input0input_text = InferTensorContents.newBuilder();
final ByteString input = ByteString.copyFrom(text, Charset.forName("UTF8"));
System.out.println(input.size());
input0input_text.addByteContents(input);https://stackoverflow.com/questions/66571840
复制相似问题