Нужна помощь с Google Vision API - PullRequest
0 голосов
/ 05 мая 2019

Я создаю приложение, использующее API Google Vision для извлечения рукописных текстов из некоторых документов изображений. У меня уже есть готовое облако Google, файл json сохранен в моей локальной папке с кодом. Я использовал облачное хранилище Google для создания сегмента, и имя блока передается в код. Мне удалось устранить некоторые ошибки (или, может быть, я действительно их уничтожил ?!), но я все еще получаю эту гигантскую ошибку в командной строке, которая:

Что это значит? Как я могу решить это?

    Input directory path is valid
    Processing File .DS_Store ...
    Traceback (most recent call last):
    File "/Users/****j/anaconda3/lib/python3.7/site-packages/google     /api_core/grpc_helpers.py", line 57, in error_remapped_callable
    return callable_(*args, **kwargs)
    File "/Users/******j/anaconda3/lib/python3.7/site-packages     /grpc/_channel.py", line 562, in __call__
    return _end_unary_response_blocking(state, call, False, None)
    File "/Users/****j/anaconda3/lib/python3.7/site-packages                               /grpc/_channel.py", line 466, in _end_unary_response_blocking
    raise _Rendezvous(state, None, None, deadline)
    grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
status = StatusCode.NOT_FOUND
details = "Error opening file: gs://ocad_images/001/.DS_Store."
debug_error_string =   "{"created":"@1557074238.415495000","description":"Error received from peer  ipv6:[2607:f8b0:400b:80f::200a]:443","file":"src/core/lib/surface /call.cc","file_line":1041,"grpc_message":"Error opening file: gs://buck_images/001/.DS_Store.","grpc_status":5}"

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
    File "input_ml.py", line 63, in <module>
    detect_hand_writtent_text(gcs_source_uri,gcs_destination_uri ,   os.path.abspath(data_dir)+"/output/"+input_file)
    File "/Users/*****j/Environments/GoogleCloud/handwriting/doc_txt_detect.py", line 36, in detect_hand_writtent_text
    requests=[async_request])
    File "/Users/*****j/anaconda3/lib/python3.7/site-packages/google/cloud/vision_v1/gapic/image_annotator_client.py", line 308, in  async_batch_annotate_files
    request, retry=retry, timeout=timeout, metadata=metadata
    File "/Users/******j/anaconda3/lib/python3.7/site-packages/google /api_core/gapic_v1/method.py", line 143, in __call__
    return wrapped_func(*args, **kwargs)
    File "/Users/****j/anaconda3/lib/python3.7/site-packages/google/api_core/retry.py", line 270, in retry_wrapped_func
    on_error=on_error,
    File "/Users/*****j/anaconda3/lib/python3.7/site-packages/google/api_core/retry.py", line 179, in retry_target
    return target()
    File "/Users/*****j/anaconda3/lib/python3.7/site-packages/google/api_core/timeout.py", line 214, in func_with_timeout
    return func(*args, **kwargs)
    File "/Users/****j/anaconda3/lib/python3.7/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.NotFound: 404 Error opening file:  gs://ocad_images/001/.DS_Store.
...