上传服务器后出现的错误如下:
Baidu.Aip.AipException: The underlying connection was closed: An unexpected error occurred on a send.
at Baidu.Aip.AipServiceBase.SendRequetRaw(AipHttpRequest aipRequest)
at Baidu.Aip.AipServiceBase.SendRequet(AipHttpRequest aipRequest)
at Baidu.Aip.AipServiceBase.PostAction(AipHttpRequest aipReq)
at Baidu.Aip.Ocr.Ocr.AccurateBasic(Byte[] image, Dictionary`2 options)
代码
private string HighAccurate(string picFullPath)
{ try
{
var APP_ID = "1773";
var API_KEY = "aaaa";
var SECRET_KEY = "bbbb";
var client = new Baidu.Aip.Ocr.Ocr(API_KEY, SECRET_KEY);
client.Timeout = 60000;
var image = File.ReadAllBytes(picFullPath);
var options = new Dictionary{
{"detect_direction", "true"},
{"probability", "true"}
}; // 带参数调用通用文字识别(高精度版)
var result = client.AccurateBasic(image, options);
return WriteTo(result.ToString());
}
catch (Exception ex)
{
CommonClass.Class_Log.Error.Log(ex.ToString());
return "HighAccurate Error";
} }
您可以提交工单问一下 我们有相关技术人员来解答。