When I run let's chat with a friend I get the following error when I get to the cell below the header 'We are now set to make a new friend'.
---------------------------------------------------------------------------
ConnectionRefusedError Traceback (most recent call last)
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/site-packages/urllib3/connection.py in _new_conn(self)
174 conn = connection.create_connection(
--> 175 (self._dns_host, self.port), self.timeout, **extra_kw
176 )
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
95 if err is not None:
---> 96 raise err
97
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
85 sock.bind(source_address)
---> 86 sock.connect(sa)
87 return sock
ConnectionRefusedError: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
NewConnectionError Traceback (most recent call last)
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/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)
705 headers=headers,
--> 706 chunked=chunked,
707 )
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
393 else:
--> 394 conn.request(method, url, **httplib_request_kw)
395
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/site-packages/urllib3/connection.py in request(self, method, url, body, headers)
238 headers["User-Agent"] = _get_default_user_agent()
--> 239 super(HTTPConnection, self).request(method, url, body=body, headers=headers)
240
~/opt/anaconda3/lib/python3.7/http/client.py in request(self, method, url, body, headers, encode_chunked)
1251 """Send a complete request to the server."""
-> 1252 self._send_request(method, url, body, headers, encode_chunked)
1253
~/opt/anaconda3/lib/python3.7/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
1297 body = _encode(body, 'body')
-> 1298 self.endheaders(body, encode_chunked=encode_chunked)
1299
~/opt/anaconda3/lib/python3.7/http/client.py in endheaders(self, message_body, encode_chunked)
1246 raise CannotSendHeader()
-> 1247 self._send_output(message_body, encode_chunked=encode_chunked)
1248
~/opt/anaconda3/lib/python3.7/http/client.py in _send_output(self, message_body, encode_chunked)
1025 del self._buffer[:]
-> 1026 self.send(msg)
1027
~/opt/anaconda3/lib/python3.7/http/client.py in send(self, data)
965 if self.auto_open:
--> 966 self.connect()
967 else:
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/site-packages/urllib3/connection.py in connect(self)
204 def connect(self):
--> 205 conn = self._new_conn()
206 self._prepare_conn(conn)
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/site-packages/urllib3/connection.py in _new_conn(self)
186 raise NewConnectionError(
--> 187 self, "Failed to establish a new connection: %s" % e
188 )
NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fe22c534d90>: Failed to establish a new connection: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
MaxRetryError Traceback (most recent call last)
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
448 retries=self.max_retries,
--> 449 timeout=timeout
450 )
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/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)
755 retries = retries.increment(
--> 756 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
757 )
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
573 if new_retry.is_exhausted():
--> 574 raise MaxRetryError(_pool, url, error or ResponseError(cause))
575
MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=10002): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe22c534d90>: Failed to establish a new connection: [Errno 61] Connection refused'))
During handling of the above exception, another exception occurred:
ConnectionError Traceback (most recent call last)
/var/folders/sz/63xmbb456zd5srhhpdyb760m0000gn/T/ipykernel_1440/3886261939.py in <module>
22 cv2.imwrite(imagepath, frame)
23
---> 24 faces = f_util.detect_faces(friends_path, imagepath)
25
26 image_bbox = (0, 0, frame.shape[1], frame.shape[0])
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/src/chatbots/util/face_util.py in detect_faces(friends_path, image_path, url_face, url_age_gender, url_yolo)
413 data = {"image": load_binary_image(image_path)}
414
--> 415 face_bboxes, det_scores, landmarks, embeddings = run_face_api(data, url_face)
416
417 faces_detected = face_recognition(friends_path, embeddings)
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/src/chatbots/util/face_util.py in run_face_api(to_send, url_face)
215 logging.debug(f"sending image to server...")
216 to_send = jsonpickle.encode(to_send)
--> 217 response = requests.post(url_face, json=to_send)
218 logging.info(f"got {response} from server!...")
219
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/site-packages/requests/api.py in post(url, data, json, **kwargs)
115 """
116
--> 117 return request('post', url, data=data, json=json, **kwargs)
118
119
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/site-packages/requests/api.py in request(method, url, **kwargs)
59 # cases, and look like a memory leak in others.
60 with sessions.Session() as session:
---> 61 return session.request(method=method, url=url, **kwargs)
62
63
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/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
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/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)
~/Vrije Universiteit Amsterdam/Communicative Robots/cltl-chatbots/venv/lib/python3.7/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:
ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=10002): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe22c534d90>: Failed to establish a new connection: [Errno 61] Connection refused'))