Forum Discussion

Wanzziey's avatar
Wanzziey
Copper Contributor
Oct 20, 2021

KeyError during AI 900 lab

After creating cognitive service resource I tried to analyze first image 'store_cam1.jpg' using own cog_keys,

though there's an KeyError:

---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
in
16 # Get a description from the computer vision service
17 image_stream = open(image_path, "rb")
---> 18 description = computervision_client.describe_image_in_stream(image_stream)
19
20 # Display image and caption (code in helper_scripts/vision.py)

~AppDataLocalProgramsPythonPython36libsite-packagesazurecognitiveservicesvisioncomputervisionoperations_computer_vision_client_operations.py in describe_image_in_stream(self, image, max_candidates, language, description_exclude, model_version, custom_headers, raw, callback, **operation_config)
1037
1038 # Construct and send request
-> 1039 request = self._client.post(url, query_parameters, header_parameters, body_content)
1040 response = self._client.send(request, stream=False, **operation_config)
1041

~AppDataLocalProgramsPythonPython36libsite-packagesmsrestservice_client.py in post(self, url, params, headers, content, form_content)
191 :param dict form_content: Form content
192 """
--> 193 request = self._request('POST', url, params, headers, content, form_content)
194 return request
195

~AppDataLocalProgramsPythonPython36libsite-packagesmsrestservice_client.py in _request(self, method, url, params, headers, content, form_content)
106 :param dict form_content: Form content
107 """
--> 108 request = ClientRequest(method, self.format_url(url))
109
110 if params:

~AppDataLocalProgramsPythonPython36libsite-packagesmsrestservice_client.py in format_url(self, url, **kwargs)
153 if not parsed.scheme or not parsed.netloc:
154 url = url.lstrip('/')
--> 155 base = self.config.base_url.format(**kwargs).rstrip('/')
156 url = urljoin(base + '/', url)
157 return url

KeyError: 'Endpoint'

 

I get the same Keyerror in every chunk of code in the lab
Before starting I always run GET_FILES

Seems like a trivial issue though I cannot solve it

Also did the same approach own PC, same result

No RepliesBe the first to reply

Resources