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
个赞
请登录后评论
TOP
切换版块
解决了么老哥 我也是同样的问题
补充一点,是自定义模板。
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)