从Python调用CustomVision预测API-第二次不是魅力

from azure.cognitiveservices.vision.customvision.prediction import CustomVisionPredictionClient
from msrest.authentication import CognitiveServicesCredentials

endpoint = 'https://####customvision-prediction.cognitiveservices.azure.com'
project_id = '####8db4-66e8-40b3-aa4a-fe3cbb30da35'
prediction_key = '####1670040b44499a8178ffe59be76e'
project_name = '####Test'

credential = CognitiveServicesCredentials(prediction_key)
predict = CustomVisionPredictionClient(endpoint,credential)

with open("./TallowTest1.jpg",mode="rb") as image_data:
    tallowresult = predict.detect_image(project_id,project_name,image_data)

我现在已经在Azure中两次创建了CustomVision资源,我想我现在已经拥有了。我同时选择了培训和预测服务。然后转到customvision.ai并创建一个项目。我上传了照片并训练了模型。现在,我正在尝试最简单的Python脚本,但仍然出现错误。最新的是这样的:

...
    raise models.CustomVisionErrorException(self._deserialize,response)
azure.cognitiveservices.vision.customvision.prediction.models._models_py3.CustomVisionErrorException: Operation returned an invalid status code 'PermissionDenied'

请注意,我现在完全愿意共享密钥。这只是一个测试,我无法使其正常运行。如果有人会告诉我如何使它工作,我将分享每个密钥。我觉得我已经尝试了键,端点,项目ID的每种组合。而且在不同情况下,我会收到不同的错误消息,但没有任何效果

相关文章

功能概要:(目前已实现功能)公共展示部分:1.网站首页展示...
大体上把Python中的数据类型分为如下几类: Number(数字) ...
开发之前第一步,就是构造整个的项目结构。这就好比作一幅画...
源码编译方式安装Apache首先下载Apache源码压缩包,地址为ht...
前面说完了此项目的创建及数据模型设计的过程。如果未看过,...
python中常用的写爬虫的库有urllib2、requests,对于大多数比...