在调用Google Vision API时遇到以下错误
Traceback (most recent call last):
File "/Users/kumarnitin/anaconda3/envs/chatty/lib/python3.6/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable
return callable_(*args, **kwargs)
File "/Users/kumarnitin/anaconda3/envs/chatty/lib/python3.6/site-packages/grpc/_channel.py", line 550, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/Users/kumarnitin/anaconda3/envs/chatty/lib/python3.6/site-packages/grpc/_channel.py", line 467, in _end_unary_response_blocking
raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "Deadline Exceeded"
debug_error_string = "{"created":"@1549374414.480926000","description":"Deadline Exceeded","file":"src/core/ext/filters/deadline/deadline_filter.cc","file_line":69,"grpc_status":14}"
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/image_ocr/views.py", line 22, in post
succ, resp = OCRHandler.handle(data)
File "/image_ocr/handler.py", line 22, in handle
res = OCRExtraction(id_type, res).handler()
File "/image_ocr/extractor.py", line 122, in handler
response = VisionOCR.detect_document(self.img_path)
File "/image_ocr/extractor.py", line 38, in detect_document
image=image, timeout=30)
File "/Users/kumarnitin/anaconda3/envs/chatty/lib/python3.6/site-packages/google/cloud/vision_helpers/decorators.py", line 101, in inner
response = self.annotate_image(request, retry=retry, timeout=timeout)
File "/Users/kumarnitin/anaconda3/envs/chatty/lib/python3.6/site-packages/google/cloud/vision_helpers/__init__.py", line 72, in annotate_image
r = self.batch_annotate_images([request], retry=retry, timeout=timeout)
File "/Users/kumarnitin/anaconda3/envs/chatty/lib/python3.6/site-packages/google/cloud/vision_v1/gapic/image_annotator_client.py", line 234, in batch_annotate_images
request, retry=retry, timeout=timeout, metadata=metadata
File "/Users/kumarnitin/anaconda3/envs/chatty/lib/python3.6/site-packages/google/api_core/gapic_v1/method.py", line 143, in __call__
return wrapped_func(*args, **kwargs)
File "/Users/kumarnitin/anaconda3/envs/chatty/lib/python3.6/site-packages/google/api_core/timeout.py", line 102, in func_with_timeout
return func(*args, **kwargs)
File "/Users/kumarnitin/anaconda3/envs/chatty/lib/python3.6/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
six.raise_from(exceptions.from_grpc_error(exc), exc)
File "<string>", line 3, in raise_from
google.api_core.exceptions.ServiceUnavailable: 503 Deadline Exceeded