【问题标题】:grpc._channel._InactiveRpcError: _InactiveRpcError of RPC that terminated with: status = StatusCode.INTERNALgrpc._channel._InactiveRpcError: _InactiveRpcError 的 RPC 终止于:status = StatusCode.INTERNAL
【发布时间】:2021-10-26 03:19:12
【问题描述】:

这是一个 gRPC 服务和客户端 python 程序。运行客户端脚本后,它会抛出此错误。特别是我对使用 API/gRPC 很陌生。如果我知道可能是什么问题,那就太好了。安装了 gRPC 库和一些支持库。

即使服务器运行正常,通过 gRPC 的通信也会以 INTERNAL 错误状态代码终止。在本地主机上运行它。

return _end_unary_response_blocking(state, call, False, None)
  File "/home/mark/anaconda3/envs/custom-model-server/lib/python3.8/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking
    raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.INTERNAL
        details = "indices[0,350] = 1650751580 is not in [0, 30522)
         [[{{node tf_bert_for_sequence_classification/bert/embeddings/Gather}}]]"
        debug_error_string = "{"created":"@1629922773.170809502","description":"Error received from peer ipv4:127.0.0.1:8001","file":"src/core/lib/surface/call.cc","file_line":1066,"grpc_message":"indices[0,350] = 1650751580 is not in [0, 30522)\n\t [[{{node tf_bert_for_sequence_classification/bert/embeddings/Gather}}]]","grpc_status":13}"
'''

【问题讨论】:

    标签: api grpc google-api-python-client grpc-python


    【解决方案1】:

    解决方案是检查传递给函数的字节数组,并确保我们采用的长度是数组本身的长度,而不是字节。所以我们能够做到:

    dimensions = len(byte_array)//4
    

    【讨论】:

      猜你喜欢
      • 2021-05-19
      • 1970-01-01
      • 2021-08-30
      • 1970-01-01
      • 2018-06-18
      • 2022-01-07
      • 2018-04-24
      • 1970-01-01
      • 2018-09-20
      相关资源
      最近更新 更多