On Mon, Aug 29, 2016 at 9:01 PM, <[email protected]> wrote:

> I wrote a server and client in Python, grpcio version is 1.0.0, protobuf
> is 3.0.0, os is centos 6.
>
> my proto file is
> -------------------------
> service AudioClassification {
> rpc Classify (AudioUnit) returns (Prob) {
> }
> }
> message AudioUnit {
>     string id = 1;
>     bytes audio = 2;
> }
> message Prob {
>     float prob = 1;
> }
> ---------------------------
>
> when I run my client, I will put an audio file content to the field audio.
> If the file size is 841772 bytes, the return will be ok, but the file size
> is large, for example,  4482088 bytes, it will return an error, the
> stacktrace is bellow:
> ------------------------------------------------------
>   File "./client2.py", line 12, in run
>     reply = stub.Classify(AudioUnit(id='1', 
> audio=bytes(open('../data/1018465138.wav',
> 'rb').read())), timeout=3600)
>   File 
> "/home/web_server/dlpy2/dlpy/lib/python2.7/site-packages/grpc/_channel.py",
> line 481, in __call__
>     return _end_unary_response_blocking(state, False, deadline)
>   File 
> "/home/web_server/dlpy2/dlpy/lib/python2.7/site-packages/grpc/_channel.py",
> line 432, in _end_unary_response_blocking
>     raise _Rendezvous(state, None, None, deadline)
> grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with
> (StatusCode.INTERNAL, {"created":"@1472528410.
> 219728253","description":"RST_STREAM","file":"src/core/ext/
> transport/chttp2/transport/frame_rst_stream.c","file_
> line":107,"http2_error":2})>
> ------------------------------------------------------
>
> my client code is:
> ---------------
> def run():
>     channel = grpc.insecure_channel('localhost:10411')
>     stub = AudioClassificationStub(channel)
>     reply = stub.Classify(AudioUnit(id='1', 
> audio=bytes(open('../data/1018465138.wav',
> 'rb').read())), timeout=3600)
>     print(reply.prob)
>
> if __name__ == '__main__':
>     run()
> ---------------
>
> Anyone can give me some tips?
>

StatusCode.INTERNAL could mean one of a few different things
<https://github.com/grpc/grpc/blob/master/doc/statuscodes.md>, but I
suspect the problem is that you're hitting the message size limit. How much
thought have you given to making your Classify method response-streaming
and breaking up your audio data into each-no-larger-than-some-size messages?
-Nathaniel

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAEOYnASazovCYfUxxHEk4NaQx8sATWu%2BG4SK%2Bn-t5iTWhUiOyw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to