![](/img/trans.png)
[英]invalid JWT error with timeframe using google-cloud-vision api on virtual windows
[英]Google Cloud Vision API error "Invalid language hints."
在過去的兩年里,我一直在使用 vision api 在我的項目中提取文本 (document_text_detection),但從未遇到過這個問題。 從昨天開始,api 隨機響應錯誤:
{ 代碼:3 消息:“無效的語言提示。” }
對於相同的圖像。 我嘗試了一堆圖像,有時 api 可以很好地提取文本,有時會為同一圖像拋出“無效的語言提示”錯誤。
我嘗試將視覺 api 庫從 v1 更新到 v2,將語言提示發送為“en”仍然存在相同的問題。 我查看了 Google 文檔並檢查了 StackOverFlow,但找不到任何解決方案。
from google.cloud import vision
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = google_cred_file
vision_client = vision.ImageAnnotatorClient()
file = open(file_path,"rb")
image = vision.Image(content=file.read())
api_resp = vision_client.document_text_detection(image=image)
if api_resp.error.message:
log.error(api_resp)
我是Google Cloud Platform Support的一員,截至 2022 年 5 月 16 日星期一 10:00 US/Pacific ,所有受影響用戶的 Cloud Vision 問題均已解決。
該問題也已從Google Cloud Service Health頁面中刪除。
您現在可以嘗試檢測文本視覺 API 快速入門或嘗試您自己的代碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.