Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ai-601.ipynb运行第一个cell出错 #11

Open
WLwind opened this issue Mar 7, 2020 · 0 comments
Open

ai-601.ipynb运行第一个cell出错 #11

WLwind opened this issue Mar 7, 2020 · 0 comments

Comments

@WLwind
Copy link

WLwind commented Mar 7, 2020

我是在ubuntu18.04本地的jupyter-notbook中运行的,错误提示如下:

ConnectionRefusedError Traceback (most recent call last)
/usr/lib/python3.6/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
1317 h.request(req.get_method(), req.selector, req.data, headers,
-> 1318 encode_chunked=req.has_header('Transfer-encoding'))
1319 except OSError as err: # timeout error

/usr/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked)
1253 """Send a complete request to the server."""
-> 1254 self._send_request(method, url, body, headers, encode_chunked)
1255

/usr/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
1299 body = _encode(body, 'body')
-> 1300 self.endheaders(body, encode_chunked=encode_chunked)
1301

/usr/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked)
1248 raise CannotSendHeader()
-> 1249 self._send_output(message_body, encode_chunked=encode_chunked)
1250

/usr/lib/python3.6/http/client.py in _send_output(self, message_body, encode_chunked)
1035 del self._buffer[:]
-> 1036 self.send(msg)
1037

/usr/lib/python3.6/http/client.py in send(self, data)
973 if self.auto_open:
--> 974 self.connect()
975 else:

/usr/lib/python3.6/http/client.py in connect(self)
1406
-> 1407 super().connect()
1408

/usr/lib/python3.6/http/client.py in connect(self)
945 self.sock = self._create_connection(
--> 946 (self.host,self.port), self.timeout, self.source_address)
947 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)

/usr/lib/python3.6/socket.py in create_connection(address, timeout, source_address)
723 if err is not None:
--> 724 raise err
725 else:

/usr/lib/python3.6/socket.py in create_connection(address, timeout, source_address)
712 sock.bind(source_address)
--> 713 sock.connect(sa)
714 # Break explicitly a reference cycle

ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

URLError Traceback (most recent call last)
in
5 import numpy as np
6 url = 'https://raw.githubusercontent.com/MachineIntellect/DeepLearner/master/J.png'
----> 7 resp = request.urlopen(url)
8 s = resp.read()
9 imgG = Image.open(io.BytesIO(s)).convert('L')

/usr/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
221 else:
222 opener = _opener
--> 223 return opener.open(url, data, timeout)
224
225 def install_opener(opener):

/usr/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)
524 req = meth(req)
525
--> 526 response = self._open(req, data)
527
528 # post-process response

/usr/lib/python3.6/urllib/request.py in _open(self, req, data)
542 protocol = req.type
543 result = self._call_chain(self.handle_open, protocol, protocol +
--> 544 '_open', req)
545 if result:
546 return result

/usr/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
502 for handler in handlers:
503 func = getattr(handler, meth_name)
--> 504 result = func(*args)
505 if result is not None:
506 return result

/usr/lib/python3.6/urllib/request.py in https_open(self, req)
1359 def https_open(self, req):
1360 return self.do_open(http.client.HTTPSConnection, req,
-> 1361 context=self._context, check_hostname=self.check_hostname)
1362
1363 https_request = AbstractHTTPHandler.do_request

/usr/lib/python3.6/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
1318 encode_chunked=req.has_header('Transfer-encoding'))
1319 except OSError as err: # timeout error
-> 1320 raise URLError(err)
1321 r = h.getresponse()
1322 except:

URLError: <urlopen error [Errno 111] Connection refused>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant