开发者社区 > 视觉智能 > 正文

视觉智能平台正常调用人脸搜索,出现了报错,应该怎么调整?

视觉智能平台正常调用人脸搜索,出现了报错,应该怎么调整? response = client.search_face_advance(search_face_request, runtime_option)
File "/usr/local/lib/python3.7/dist-packages/alibabacloud_facebody20191230/client.py", line 9903, in search_face_advance
oss_client.post_object(upload_request, oss_runtime)
File "/usr/local/lib/python3.7/dist-packages/alibabacloud_oss_sdk/client.py", line 9845, in post_object
raise e
File "/usr/local/lib/python3.7/dist-packages/alibabacloud_oss_sdk/client.py", line 9823, in post_object
_response = TeaCore.do_action(_request, _runtime)
File "/usr/local/lib/python3.7/dist-packages/Tea/core.py", line 221, in do_action
cert=cert,
File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 450, in send
timeout=timeout
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 710, in urlopen
chunked=chunked,
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 398, in _make_request
conn.request(method, url, *httplib_request_kw)
File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 239, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/lib/python3.7/http/client.py", line 1260, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1301, in _send_request
self.putheader(hdr, value)
File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 224, in putheader
_HTTPConnection.putheader(self, header,
values)
File "/usr/lib/python3.7/http/client.py", line 1233, in putheader
values[i] = one_value.encode('latin-1')
UnicodeEncodeError: 'latin-1' codec can't encode character '\u4e94' in position 0: ordinal not in range(256)

展开
收起
真的很搞笑 2024-05-08 12:26:57 12 0
2 条回答
写回答
取消 提交回答
  • 从事java行业9年至今,热爱技术,热爱以博文记录日常工作,csdn博主,座右铭是:让技术不再枯燥,让每一位技术人爱上技术

    您好,根据错误提示 'latin-1' codec can't encode character '\u4e94' in position 0: ordinal not in range(256) 来看是在尝试将HTTP请求头中的某个值编码为latin-1(也称为ISO-8859-1)时发生的。latin-1是一种只能表示256个字符的编码方式,而中文字符(如\u4e94)的Unicode码点超出了这个范围。建议您检查一下图片URL链接中是否包含有中文字符。

    2024-05-10 20:14:32
    赞同 展开评论 打赏
  • 这个报错看是编码的问题,是不是上传的图片URL有空格或者中文,导致编码有问题,人脸搜索文档有提示不支持中文字符的传入。
    image.png

    2024-05-08 16:30:37
    赞同 展开评论 打赏

为开发者提供高易用、普惠的视觉API服务,帮助企业快速建立视觉智能技术应用能力的综合性视觉AI能力平台。适用于数字营销、互联网娱乐、安防、手机应用、泛金融身份认证等行业。

相关产品

  • 视觉智能开放平台
  • 热门讨论

    热门文章

    相关电子书

    更多
    阿里云视觉智能开放平台-产品介绍 立即下载
    阿里云视觉智能开放平台产品介绍 立即下载
    利用CNN实现无需联网的图像识别 立即下载