老師,運(yùn)行regression.py報(bào)錯(cuò)
WARNING:tensorflow:From /Users/chenwengang/Test/mnist/regression.py:4: read_data_sets (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
2018-05-30
如果感覺老師講的還不錯(cuò),可以到評(píng)論區(qū)給老師一個(gè)好評(píng)
2018-05-24
從你的截圖看來(lái),這是警告,并沒有報(bào)錯(cuò),請(qǐng)問最后無(wú)法運(yùn)行出來(lái)結(jié)果是嗎?
2018-05-24
Please use urllib or similar directly.
Traceback (most recent call last):
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
? ? encode_chunked=req.has_header('Transfer-encoding'))
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
? ? self._send_request(method, url, body, headers, encode_chunked)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
? ? self.endheaders(body, encode_chunked=encode_chunked)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
? ? self._send_output(message_body, encode_chunked=encode_chunked)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
? ? self.send(msg)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
? ? self.connect()
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1392, in connect
? ? super().connect()
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 936, in connect
? ? (self.host,self.port), self.timeout, self.source_address)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 724, in create_connection
? ? raise err
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 713, in create_connection
? ? sock.connect(sa)
OSError: [Errno 65] No route to host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
? File "/Users/chenwengang/Test/mnist/regression.py", line 4, in <module>
? ? data = input_data.read_data_sets('MNIST_data',one_hot=True)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 250, in new_func
? ? return func(*args, **kwargs)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py", line 260, in read_data_sets
? ? source_url + TRAIN_IMAGES)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 250, in new_func
? ? return func(*args, **kwargs)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py", line 252, in maybe_download
? ? temp_file_name, _ = urlretrieve_with_retry(source_url)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 250, in new_func
? ? return func(*args, **kwargs)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py", line 205, in wrapped_fn
? ? return fn(*args, **kwargs)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py", line 233, in urlretrieve_with_retry
? ? return urllib.request.urlretrieve(url, filename)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 248, in urlretrieve
? ? with contextlib.closing(urlopen(url, data)) as fp:
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
? ? return opener.open(url, data, timeout)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
? ? response = self._open(req, data)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
? ? '_open', req)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
? ? result = func(*args)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
? ? context=self._context, check_hostname=self._check_hostname)
? File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
? ? raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 65] No route to host>