qanswer icon indicating copy to clipboard operation
qanswer copied to clipboard

百度OCR API call 失败

Open airbob opened this issue 7 years ago • 2 comments

tesseract没问题。 Baidu的话API key 和secret key 都设置好了,运行后会遇到如下错误

[error] 识别答案失败,Post https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token=12.bd6fe5ea478635e5196cb2a4b8e05802.2592000.1518403263.282335-10684168: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
[error] 识别题目失败,Post https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token=12.bd6fe5ea478635e5196cb2a4b8e05802.2592000.1518403263.282335-10684168: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

查看了下后台,没有API调用, 有人遇到过同样问题吗?

airbob avatar Jan 13 '18 02:01 airbob

接口请求超时了。 你把这个 https://github.com/silenceper/qanswer/blob/master/ocr/baidu.go#L60 时间调大一点看下.

silenceper avatar Jan 13 '18 06:01 silenceper

@silenceper 谢谢! 调到120还是不可以,我试了其它语言的SDK,可以返回结果,但是response time也是很久。 可能对国外request没有优化吧,我从新加坡request的。

airbob avatar Jan 13 '18 07:01 airbob