【问题标题】:grpc.framework.interfaces.face.face.AbortionError: AbortionError(code=StatusCode.RESOURCE_EXHAUSTED, details="Received message larger than maxgrpc.framework.interfaces.face.face.AbortionError: AbortionError(code=StatusCode.RESOURCE_EXHAUSTED, details="收到的消息大于最大值
【发布时间】:2018-01-15 22:20:04
【问题描述】:

我在 keras 中构建了一个分割模型,并希望在 tensorflow 服务中运行该模型。目前我可以导出模型并运行模型服务器,但是运行 client.py 文件时输出太大。错误是:

  File "/home/.../serving/bazel-bin/tensorflow_serving/car_mask/mask_client.runfiles/tf_serving/tensorflow_serving/car_mask/mask_client.py", line 47, in <module>
    result = stub.Predict(request, 10.0)
  File "/usr/local/lib/python2.7/dist-packages/grpc/beta/_client_adaptations.py", line 310, in __call__
    self._request_serializer, self._response_deserializer)
  File "/usr/local/lib/python2.7/dist-packages/grpc/beta/_client_adaptations.py", line 196, in _blocking_unary_unary
    raise _abortion_error(rpc_error_call)
grpc.framework.interfaces.face.face.AbortionError: AbortionError(code=StatusCode.RESOURCE_EXHAUSTED, details="Received message larger than max (4194349 vs. 4194304)")

如何解决这个问题?有没有办法添加任何 grpc 选项来增加 client.py 文件中的消息大小?谢谢!

【问题讨论】:

    标签: grpc tensorflow-serving


    【解决方案1】:

    你可以试试这个:

    import grpc.beta.implementations
    from grpc._cython import cygrpc
    
    def insecure_channel(host, port):
            channel = grpc.insecure_channel(
                target=host if port is None else '%s:%d' % (host, port),
                options=[(cygrpc.ChannelArgKey.max_send_message_length, -1),
                         (cygrpc.ChannelArgKey.max_receive_message_length, -1)])
            return grpc.beta.implementations.Channel(channel)
    

    来自here

    【讨论】:

      猜你喜欢
      • 2021-12-07
      • 2019-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多