提示错误:
root@localhost:/home/wwwroot/python# python t.py
Traceback (most recent call last):
File "t.py", line 22, in
print client.basicGeneral(image,options)
AttributeError: AipOcr instance has no attribute 'basicGeneral'
t.py文件代码如下:
#!/usr/bin/python
# _*_ coding:utf-8 _*_
from aip import AipOcr
import os
filePath='/home/wwwroot/python/upload/1212.png' #服务器端图片地址
with open(filePath, 'rb') as fp:
image=fp.read()
APP_ID = '***'
API_KEY = '***'
SECRET_KEY = '***'
client = AipOcr(APP_ID, API_KEY, SECRET_KEY)
options = {}
options["language_type"] = "CHN_ENG"
options["detect_direction"] = "false"
options["detect_language"] = "false"
options["probability"] = "false"
print client.basicGeneral(image, options)
服务器环境:linux、python 2.7
本地电脑运行如上代码正常识别文字
收藏
点赞
0
个赞
请登录后评论
TOP
切换版块
我也是这个问题。用c#端就没有问题,甚至是在xamarin.form中用都没有问题,但是在python3.6版本中用就有你的问题,不知道是咋回事哈。坑,大坑。
在线等~