为了账号安全,请及时绑定邮箱和手机立即绑定

老师,运行regression.py报错

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.


正在回答

3 回答

如果感觉老师讲的还不错,可以到评论区给老师一个好评

0 回复 有任何疑惑可以回复我~

从你的截图看来,这是警告,并没有报错,请问最后无法运行出来结果是吗?

0 回复 有任何疑惑可以回复我~
#1

风硕依源 提问者

老师,我把完整的报错发在下面了
2018-05-24 回复 有任何疑惑可以回复我~
#2

Mr_Ricky 回复 风硕依源 提问者

看看是不是没有配置注解
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>


0 回复 有任何疑惑可以回复我~
#1

Mr_Ricky

你对照下代码,应该是代码问题
2018-05-24 回复 有任何疑惑可以回复我~
#2

慕慕5050018

SSL: CERTIFICATE_VERIFY_FAILED, 貌似下载数据集用的默认URL被加了SSL权限认证
2018-05-28 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

老师,运行regression.py报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信