gRPC 需要一个字节格式的值。查询请求不喜欢 gRPC 中的张量类型。我对 gRPC/API 很陌生。
Traceback (most recent call last):
File "basic_grpc_example.py", line 120, in <module>
request = client.PrimalRequest(
TypeError: <tf.Tensor: shape=(1, 512), dtype=int32, numpy=
array([[ 101, 1053, 2015, 2966, 2373, 1997, 4 has type tensorflow.python.framework.ops.EagerTensor, but expected one of: bytes, unicode
已尝试使用 .tobytes() 和字节转换,但由于某种原因它不喜欢张量格式,感谢任何帮助。