为什么读取MINST就报错?
kaggle吧
全部回复
仅看楼主
level 1
2019年09月07日 10点09分 1
level 1
---------------------------------------------------------------------------gaierror Traceback (most recent call last)/opt/conda/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/opt/conda/lib/python3.6/http/client.py in request(self, method, url, body, headers, encode_chunked) 1238 """Send a complete request to the server."""-> 1239 self._send_request(method, url, body, headers, encode_chunked) 1240 /opt/conda/lib/python3.6/http/client.py in _send_request(self, method, url, body, headers, encode_chunked) 1284 body = _encode(body, 'body')-> 1285 self.endheaders(body, encode_chunked=encode_chunked) 1286 /opt/conda/lib/python3.6/http/client.py in endheaders(self, message_body, encode_chunked) 1233 raise CannotSendHeader()-> 1234 self._send_output(message_body, encode_chunked=encode_chunked) 1235 /opt/conda/lib/python3.6/http/client.py in _send_output(self, message_body, encode_chunked) 1025 del self._buffer[:]-> 1026 self.send(msg) 1027 /opt/conda/lib/python3.6/http/client.py in send(self, data) 963 if self.auto_open:--> 964 self.connect() 965 else:/opt/conda/lib/python3.6/http/client.py in connect(self) 1391 -> 1392 super().connect() 1393 /opt/conda/lib/python3.6/http/client.py in connect(self) 935 self.sock = self._create_connection(--> 936 (self.host,self.port), self.timeout, self.source_address) 937 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)/opt/conda/lib/python3.6/socket.py in create_connection(address, timeout, source_address) 703 err = None--> 704 for res in getaddrinfo(host, port, 0, SOCK_STREAM): 705 af, socktype, proto, canonname, sa = res/opt/conda/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 = resgaierror: [Errno -3] Temporary failure in name resolutionDuring handling of the above exception, another exception occurred:URLError Traceback (most recent call last)<ipython-input-4-286f29786bef> in <module> 1 #载入数据集----> 2 mnist=input_data.read_data_sets('/kaggle/input/mnist_dataset',one_hot=True) 3 4 5 /opt/conda/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py in new_func(*args, **kwargs) 322 'in a future version' if date is None else ('after %s' % date), 323 instructions)--> 324 return func(*args, **kwargs) 325 return tf_decorator.make_decorator( 326 func, new_func, 'deprecated',/opt/conda/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py in read_data_sets(train_dir, fake_data, one_hot, dtype, reshape, validation_size, seed, source_url) 258 259 local_file = base.maybe_download(TRAIN_IMAGES, train_dir,--> 260 source_url + TRAIN_IMAGES) 261 with gfile.Open(local_file, 'rb') as f: 262 train_images = extract_images(f)/opt/conda/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py in new_func(*args, **kwargs) 322 'in a future version' if date is None else ('after %s' % date), 323 instructions)--> 324 return func(*args, **kwargs) 325 return tf_decorator.make_decorator( 326 func, new_func, 'deprecated',/opt/conda/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py 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:/opt/conda/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py in new_func(*args, **kwargs) 322 'in a future version' if date is None else ('after %s' % date), 323 instructions)--> 324 return func(*args, **kwargs) 325 return tf_decorator.make_decorator( 326 func, new_func, 'deprecated',/opt/conda/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py 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:/opt/conda/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py 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 /opt/conda/lib/python3.6/urllib/request.py in urlretrieve(url, filename, reporthook, data) 246 url_type, path = splittype(url) 247 --> 248 with contextlib.closing(urlopen(url, data)) as fp: 249 headers = fp.info() 250 /opt/conda/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):/opt/conda/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/opt/conda/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/opt/conda/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/opt/conda/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_/opt/conda/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 -3] Temporary failure in name resolution>
2019年09月07日 10点09分 2
level 1
2019年09月07日 10点09分 3
level 1
应该是没有联网的问题吧
2019年09月12日 16点09分 4
不是,我肯定百分比确定
2019年09月13日 00点09分
level 1
右上角点开 右边下面setting里的 internet 打开 就可以了
2019年09月13日 12点09分 5
原来下载数据集的时候,必须要验证手机号才行,开internet
2019年09月14日 01点09分
开了也没用。。。还是那个错误,我还挂的V
2019年09月14日 02点09分
1