Я пытаюсь использовать следующие коды в блокноте Juypter:
import tensorflow as tf
import tensorflow.examples.tutorials.mnist.input_data as input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
, но получаю следующую ошибку:
Extracting MNIST_data/train-images-idx3-ubyte.gz
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
<ipython-input-9-aeeb0aa14838> in <module>()
3 import tensorflow.examples.tutorials.mnist.input_data as input_data
----> 4 mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
5 print("MNIST downloaded.")
/usr/local/lib/python2.7/site-packages/tensorflow/python/util/deprecation.pyc in new_func(*args, **kwargs)
248 'in a future version' if date is None else ('after %s' % date),
249 instructions)
--> 250 return func(*args, **kwargs)
251 return tf_decorator.make_decorator(
252 func, new_func, 'deprecated',
/usr/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.pyc in read_data_sets(train_dir, fake_data, one_hot, dtype, reshape, validation_size, seed, source_url)
263
264 local_file = base.maybe_download(TRAIN_LABELS, train_dir,
--> 265 source_url + TRAIN_LABELS)
266 with gfile.Open(local_file, 'rb') as f:
267 train_labels = extract_labels(f, one_hot=one_hot)
/usr/local/lib/python2.7/site-packages/tensorflow/python/util/deprecation.pyc in new_func(*args, **kwargs)
248 'in a future version' if date is None else ('after %s' % date),
249 instructions)
--> 250 return func(*args, **kwargs)
251 return tf_decorator.make_decorator(
252 func, new_func, 'deprecated',
/usr/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.pyc in maybe_download(filename, work_directory, source_url)
250 filepath = os.path.join(work_directory, filename)
251 if not gfile.Exists(filepath):
--> 252 temp_file_name, _ = urlretrieve_with_retry(source_url)
253 gfile.Copy(temp_file_name, filepath)
254 with gfile.GFile(filepath) as f:
/usr/local/lib/python2.7/site-packages/tensorflow/python/util/deprecation.pyc in new_func(*args, **kwargs)
248 'in a future version' if date is None else ('after %s' % date),
249 instructions)
--> 250 return func(*args, **kwargs)
251 return tf_decorator.make_decorator(
252 func, new_func, 'deprecated',
/usr/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.pyc in wrapped_fn(*args, **kwargs)
203 for delay in delays():
204 try:
--> 205 return fn(*args, **kwargs)
206 except Exception as e: # pylint: disable=broad-except
207 if is_retriable is None:
/usr/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.pyc in urlretrieve_with_retry(url, filename)
231 @_internal_retry(initial_delay=1.0, max_delay=16.0, is_retriable=_is_retriable)
232 def urlretrieve_with_retry(url, filename=None):
--> 233 return urllib.request.urlretrieve(url, filename)
234
235
/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.pyc in urlretrieve(url, filename, reporthook, data, context)
96 else:
97 opener = _urlopener
---> 98 return opener.retrieve(url, filename, reporthook, data)
99 def urlcleanup():
100 if _urlopener:
/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.pyc in retrieve(self, url, filename, reporthook, data)
243 except IOError:
244 pass
--> 245 fp = self.open(url, data)
246 try:
247 headers = fp.info()
/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.pyc in open(self, fullurl, data)
211 try:
212 if data is None:
--> 213 return getattr(self, name)(url)
214 else:
215 return getattr(self, name)(url, data)
/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.pyc in open_https(self, url, data)
441 if realhost: h.putheader('Host', realhost)
442 for args in self.addheaders: h.putheader(*args)
--> 443 h.endheaders(data)
444 errcode, errmsg, headers = h.getreply()
445 fp = h.getfile()
/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.pyc in endheaders(self, message_body)
1036 else:
1037 raise CannotSendHeader()
-> 1038 self._send_output(message_body)
1039
1040 def request(self, method, url, body=None, headers={}):
/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.pyc in _send_output(self, message_body)
880 msg += message_body
881 message_body = None
--> 882 self.send(msg)
883 if message_body is not None:
884 #message_body was not a string (i.e. it is a file) and
/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.pyc in send(self, data)
842 if self.sock is None:
843 if self.auto_open:
--> 844 self.connect()
845 else:
846 raise NotConnected()
/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.pyc in connect(self)
1253 "Connect to a host on a given (SSL) port."
1254
-> 1255 HTTPConnection.connect(self)
1256
1257 if self._tunnel_host:
/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.pyc in connect(self)
819 """Connect to the host and port specified in __init__."""
820 self.sock = self._create_connection((self.host,self.port),
--> 821 self.timeout, self.source_address)
822
823 if self._tunnel_host:
/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.pyc in create_connection(address, timeout, source_address)
573
574 if err is not None:
--> 575 raise err
576 else:
577 raise error("getaddrinfo returns an empty list")
IOError: [Errno socket error] [Errno 65] No route to host
Есть идеи почему?Спасибо.