You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
speech_streaming.py got an error on a Raspberry Pi #374
I got an error on a Raspberry Pi (Raspberry Pi 2 Model B, Raspbian Jessie May 2016) as follows. I could run the example successfully only once, but fails in many cases due to same error.
$ python speech_streaming.py
...
Traceback (most recent call last):
File "speech_streaming.py", line 145, in <module>
main()
File "speech_streaming.py", line 137, in main
service.Recognize(request_stream(stop_audio), DEADLINE_SECS))
File "speech_streaming.py", line 114, in listen_print_loop
for resp in recognize_stream:
File "/usr/local/lib/python2.7/dist-packages/grpc/framework/crust/_control.py", line 415, in next
raise self._termination.abortion_error
grpc.framework.interfaces.face.face.LocalError: LocalError(code=None, details="None")
I confirmed that the following example works as expected, so the hardware (i.e. a USB microphone) and the PyAudio library seems to be fine.
+1 exact same problem here, except on Ubuntu 14.04. Maybe the python generator returned by service.Recognize(request_stream(stop_audio), DEADLINE_SECS)) has some sort of issue with iteration? Or is this even a normal python generator? Looking through the stub code was not enlightening.
Yeah - the stub code isn't great.
Usually when I hit a LocalError, it meant that some exception was being thrown in the background thread - ie the thread that generates RecognizeRequests. Unfortunately there's a bug in grpc that swallows the actual exception, so you'll get a LocalError for all sorts of things that go wrong.
You might try creating a recognize_stream manually and iterating through it, and making sure it's giving you sane objects instead of throwing exceptions :)
For future reference, When grpcio==0.14.0 was installed (as per the requirements file) the type returned by service.Recognize() is "grpc.framework.crust._control.Rendezvous object".
With grpcio==0.15.0 or grpcio==0.16.0 the type returned is grpc.beta._client_adaptations._Rendezvous object.
Interestingly enough both of these work fine.
edit: In my own code I had forgotten to put parentheses next to the generator function I passed to Recognize. This resulted in the infrastructure attempting to iterate over the function instead of a generator object, which eventually manifested itself in a LocalError.
Activity
github-user-72574089 commentedon Jun 27, 2016
+1 exact same problem here, except on Ubuntu 14.04. Maybe the python generator returned by
service.Recognize(request_stream(stop_audio), DEADLINE_SECS))has some sort of issue with iteration? Or is this even a normal python generator? Looking through the stub code was not enlightening.jerjou commentedon Jun 27, 2016
Yeah - the stub code isn't great.
Usually when I hit a LocalError, it meant that some exception was being thrown in the background thread - ie the thread that generates
RecognizeRequests. Unfortunately there's a bug in grpc that swallows the actual exception, so you'll get a LocalError for all sorts of things that go wrong.You might try creating a recognize_stream manually and iterating through it, and making sure it's giving you sane objects instead of throwing exceptions :)
github-user-72574089 commentedon Jun 29, 2016
For future reference, When
grpcio==0.14.0was installed (as per the requirements file) the type returned byservice.Recognize()is"grpc.framework.crust._control.Rendezvous object".With
grpcio==0.15.0 or grpcio==0.16.0the type returned isgrpc.beta._client_adaptations._Rendezvous object.Interestingly enough both of these work fine.
edit: In my own code I had forgotten to put parentheses next to the generator function I passed to
Recognize. This resulted in the infrastructure attempting to iterate over the function instead of a generator object, which eventually manifested itself in a LocalError.jerjou commentedon Jul 13, 2016
Filed as grpc/grpc#7367
jerjou commentedon Jul 14, 2016
FTR,
grpcio==0.15.0appears to show the actual error, instead of theLocalError.chore(deps): update dependency pytest to v7.1.3 (#374)
chore(deps): update dependency google-auth to v2.11.1 (#374)
chore(deps): update dependency pytest to v7.1.3 (#374)
chore(deps): update dependency pytest to v7.1.3 (#374)
chore(deps): update dependency pytest to v7.1.3 (#374)
chore(deps): update dependency google-cloud-speech to v2.14.0 (#374)
chore: use gapic-generator-python 0.65.1 (#374)
chore(deps): update dependency google-cloud-speech to v2.14.0 (#374)
chore(deps): update dependency google-cloud-speech to v2.14.0 (#374)
chore(deps): update dependency google-cloud-pubsub to v2.13.5 (#374)
chore(deps): update dependency google-cloud-pubsub to v2.13.5 (#374)
chore(deps): update dependency google-cloud-pubsub to v2.13.5 (#374)
chore(deps): update dependency backoff to v2.2.1 (#374)
chore(deps): update dependency backoff to v2.2.1 (#374)
chore(deps): update dependency google-cloud-bigquery to v2.24.0 (#374)
migrate code from googleapis/python-logging (#13844)