1 year ago

#291067

test-img

michael zhang

error message of calling media translation api of GCP

I followed the tutorial in the
https://github.com/GoogleCloudPlatform/community/blob/master/tutorials/ar-subs/index.md to create Real-Time Video Translation with AR Subtitles.

After following all steps correctly, when I attempt to call the media translation API by typing in

python3 translate-microphone.py --lang it-IT --dev 0

but that doesn't work at all and the error message as follows:

Press any key to translate or 'q' to quit: Begin speaking...

^CTraceback (most recent call last):
  File "/home/pi/community/tutorials/ar-subs/translate-microphone.py", line 198, in <module>
    main()
  File "/home/pi/community/tutorials/ar-subs/translate-microphone.py", line 194, in main
    do_translation_loop(args.dev, args.lang)
  File "/home/pi/community/tutorials/ar-subs/translate-microphone.py", line 175, in do_translation_loop
    responses = client.streaming_translate_speech(requests)
  File "/home/pi/community/tutorials/ar-subs/venv/lib/python3.9/site-packages/google/cloud/mediatranslation_v1beta1/services/speech_translation_service/client.py", line 467, in streaming_translate_speech
    response = rpc(requests, retry=retry, timeout=timeout, metadata=metadata,)
  File "/home/pi/community/tutorials/ar-subs/venv/lib/python3.9/site-packages/google/api_core/gapic_v1/method.py", line 154, in __call__
    return wrapped_func(*args, **kwargs)
  File "/home/pi/community/tutorials/ar-subs/venv/lib/python3.9/site-packages/google/api_core/grpc_helpers.py", line 156, in error_remapped_callable
    return _StreamingResponseIterator(
  File "/home/pi/community/tutorials/ar-subs/venv/lib/python3.9/site-packages/google/api_core/grpc_helpers.py", line 82, in __init__
    self._stored_first_result = next(self._wrapped)
  File "/home/pi/community/tutorials/ar-subs/venv/lib/python3.9/site-packages/grpc/_channel.py", line 426, in __next__
    return self._next()
  File "/home/pi/community/tutorials/ar-subs/venv/lib/python3.9/site-packages/grpc/_channel.py", line 817, in _next
    _common.wait(self._state.condition.wait, _response_ready)
  File "/home/pi/community/tutorials/ar-subs/venv/lib/python3.9/site-packages/grpc/_common.py", line 141, in wait
    _wait_once(wait_fn, MAXIMUM_WAIT_TIMEOUT, spin_cb)
  File "/home/pi/community/tutorials/ar-subs/venv/lib/python3.9/site-packages/grpc/_common.py", line 106, in _wait_once
    wait_fn(timeout=timeout)
  File "/usr/lib/python3.9/threading.py", line 316, in wait
    gotit = waiter.acquire(True, timeout)
KeyboardInterrupt

I googled that for a few days but got nothing.

python

google-cloud-platform

raspberry-pi

machine-translation

0 Answers

Your Answer

Accepted video resources