gaierror Traceback (most recent call last)
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/urllib3/connection.py in _new_conn(self)
159 conn = connection.create_connection(
--> 160 (self._dns_host, self.port), self.timeout, **extra_kw
161 )
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
60
---> 61 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
62 af, socktype, proto, canonname, sa = res
/anaconda/envs/azureml_py36/lib/python3.6/socket.py in getaddrinfo(host, port, family, type, proto, flags)
744 addrlist = []
--> 745 for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
746 af, socktype, proto, canonname, sa = res
gaierror: [Errno -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
NewConnectionError Traceback (most recent call last)
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
676 headers=headers,
--> 677 chunked=chunked,
678 )
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
380 try:
--> 381 self._validate_conn(conn)
382 except (SocketTimeout, BaseSSLError) as e:
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/urllib3/connectionpool.py in _validate_conn(self, conn)
977 if not getattr(conn, "sock", None): # AppEngine might not have .sock
--> 978 conn.connect()
979
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/urllib3/connection.py in connect(self)
308 # Add certificate verification
--> 309 conn = self._new_conn()
310 hostname = self.host
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/urllib3/connection.py in _new_conn(self)
171 raise NewConnectionError(
--> 172 self, "Failed to establish a new connection: %s" % e
173 )
NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f1930717e80>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
MaxRetryError Traceback (most recent call last)
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
448 retries=self.max_retries,
--> 449 timeout=timeout
450 )
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
766 body_pos=body_pos,
--> 767 **response_kw
768 )
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
766 body_pos=body_pos,
--> 767 **response_kw
768 )
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
766 body_pos=body_pos,
--> 767 **response_kw
768 )
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
726 retries = retries.increment(
--> 727 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
728 )
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
445 if new_retry.is_exhausted():
--> 446 raise MaxRetryError(_pool, url, error or ResponseError(cause))
447
MaxRetryError: HTTPSConnectionPool(host='shush-fruits.cognitiveservices.azure.com', port=443): Max retries exceeded with url: /customvision/v3.1/prediction/b3c22f2d-12a4-4c90-a7aa-60cb1e9628e3/classify/iterations/fruits/image (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1930717e80>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
During handling of the above exception, another exception occurred:
ConnectionError Traceback (most recent call last)
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/msrest/universal_http/requests.py in send(self, request, **kwargs)
141 request.url,
--> 142 **kwargs)
143 except requests.RequestException as err:
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
541 send_kwargs.update(settings)
--> 542 resp = self.send(prep, **send_kwargs)
543
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/requests/sessions.py in send(self, request, **kwargs)
654 # Send the request
--> 655 r = adapter.send(request, **kwargs)
656
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
515
--> 516 raise ConnectionError(e, request=request)
517
ConnectionError: HTTPSConnectionPool(host='shush-fruits.cognitiveservices.azure.com', port=443): Max retries exceeded with url: /customvision/v3.1/prediction/b3c22f2d-12a4-4c90-a7aa-60cb1e9628e3/classify/iterations/fruits/image (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1930717e80>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
During handling of the above exception, another exception occurred:
ClientRequestError Traceback (most recent call last)
in
4 # Open the image, and use the custom vision model to classify it
5 image_contents = open(os.path.join(test_folder, test_images[i]), "rb")
----> 6 classification = custom_vision_client.classify_image(project_id, model_name, image_contents.read())
7 # The results include a prediction for each tag, in descending order of probability - get the first one
8 prediction = classification.predictions[0].tag_name
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azure/cognitiveservices/vision/customvision/prediction/operations/_custom_vision_prediction_client_operations.py in classify_image(self, project_id, published_name, image_data, application, custom_headers, raw, **operation_config)
71 # Construct and send request
72 request = self._client.post(url, query_parameters, header_parameters, form_content=form_data_content)
---> 73 response = self._client.send(request, stream=False, **operation_config)
74
75 if response.status_code not in [200]:
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/msrest/service_client.py in send(self, request, headers, content, **kwargs)
334 kwargs.setdefault('stream', True)
335 try:
--> 336 pipeline_response = self.config.pipeline.run(request, **kwargs)
337 # There is too much thing that expects this method to return a "requests.Response"
338 # to break it in a compatible release.
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/msrest/pipeline/init.py in run(self, request, **kwargs)
195 pipeline_request = Request(request, context) # type: Request[HTTPRequestType]
196 first_node = self._impl_policies[0] if self._impl_policies else self._sender
--> 197 return first_node.send(pipeline_request, **kwargs) # type: ignore
198
199 class HTTPSender(AbstractContextManager, ABC, Generic[HTTPRequestType, HTTPResponseType]):
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/msrest/pipeline/init.py in send(self, request, **kwargs)
148 self._policy.on_request(request, **kwargs)
149 try:
--> 150 response = self.next.send(request, **kwargs)
151 except Exception:
152 if not self._policy.on_exception(request, **kwargs):
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/msrest/pipeline/requests.py in send(self, request, **kwargs)
70 try:
71 try:
---> 72 return self.next.send(request, **kwargs)
73 except (oauth2.rfc6749.errors.InvalidGrantError,
74 oauth2.rfc6749.errors.TokenExpiredError) as err:
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/msrest/pipeline/requests.py in send(self, request, **kwargs)
135
136 try:
--> 137 return self.next.send(request, **kwargs)
138 finally:
139 if old_max_redirects:
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/msrest/pipeline/init.py in send(self, request, **kwargs)
148 self._policy.on_request(request, **kwargs)
149 try:
--> 150 response = self.next.send(request, **kwargs)
151 except Exception:
152 if not self._policy.on_exception(request, **kwargs):
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/msrest/pipeline/requests.py in send(self, request, **kwargs)
191 return Response(
192 request,
--> 193 self.driver.send(request.http_request, **kwargs)
194 )
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/msrest/universal_http/requests.py in send(self, request, **kwargs)
331 """
332 requests_kwargs = self._configure_send(request, **kwargs)
--> 333 return super(RequestsHTTPSender, self).send(request, **requests_kwargs)
334
335
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/msrest/universal_http/requests.py in send(self, request, **kwargs)
143 except requests.RequestException as err:
144 msg = "Error occurred in request."
--> 145 raise_with_traceback(ClientRequestError, msg, err)
146
147 return RequestsClientResponse(request, response)
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/msrest/exceptions.py in raise_with_traceback(exception, message, *args, **kwargs)
49 error = exception(exc_msg, *args, **kwargs)
50 try:
---> 51 raise error.with_traceback(exc_traceback)
52 except AttributeError:
53 error.traceback = exc_traceback
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/msrest/universal_http/requests.py in send(self, request, **kwargs)
140 request.method,
141 request.url,
--> 142 **kwargs)
143 except requests.RequestException as err:
144 msg = "Error occurred in request."
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
540 }
541 send_kwargs.update(settings)
--> 542 resp = self.send(prep, **send_kwargs)
543
544 return resp
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/requests/sessions.py in send(self, request, **kwargs)
653
654 # Send the request
--> 655 r = adapter.send(request, **kwargs)
656
657 # Total elapsed time of the request (approximately)
/anaconda/envs/azureml_py36/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
514 raise SSLError(e, request=request)
515
--> 516 raise ConnectionError(e, request=request)
517
518 except ClosedPoolError as e:
ClientRequestError: Error occurred in request., ConnectionError: HTTPSConnectionPool(host='shush-fruits.cognitiveservices.azure.com', port=443): Max retries exceeded with url: /customvision/v3.1/prediction/b3c22f2d-12a4-4c90-a7aa-60cb1e9628e3/classify/iterations/fruits/image (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1930717e80>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))