没有'basicGeneral'属性???
定心天下 发布于2018-10 浏览:2385 回复:2
0
收藏

提示错误:

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
个赞
共2条回复 最后由用户已被禁言回复于2022-04
#3ni75089504回复于2018-12

我也是这个问题。用c#端就没有问题,甚至是在xamarin.form中用都没有问题,但是在python3.6版本中用就有你的问题,不知道是咋回事哈。坑,大坑。

0
#2定心天下回复于2018-10

在线等~

0
TOP
切换版块