Python SDK调用,出错,求助。
138******52 发布于2019-03 浏览:1763 回复:2
0
收藏

python3,错误如下,请问如何解决:

Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/3.25/3.25.4.py", line 20, in
client.custom(image, templateSign)
File "C:\Users\Administrator\PycharmProjects\3.25\venv\lib\site-packages\aip\ocr.py", line 464, in custom
data.update(options)
ValueError: dictionary update sequence element #0 has length 1; 2 is required

收藏
点赞
0
个赞
共2条回复 最后由用户已被禁言回复于2022-04
#3a941613528回复于2020-01

解决了么老哥  我也是同样的问题

 

0
#2138******52回复于2019-03

补充一点,是自定义模板。

from aip import AipOcr

""" 你的 APPID AK SK """
APP_ID = '***************'
API_KEY = '****************************'
SECRET_KEY = '********************************'

client = AipOcr(APP_ID, API_KEY, SECRET_KEY)

""" 读取图片 """
def get_file_content(filePath):
with open(filePath, 'rb') as fp:
return fp.read()


image = get_file_content('E:/Desktop/pycharm.png')
templateSign = "***********************"

""" 调用自定义模版文字识别 """
client.custom(image, templateSign)

0
TOP
切换版块