Open zhyongquan opened 6 years ago
it may be because data download. i download data manually from http://yann.lecun.com/exdb/mnist/ and changed mnist.py. basic models work. but random_forest still bad.
`
mnist_path = "D:\PYProjects\tensorflow\mnist\"
TRAIN_IMAGES = 'train-images-idx3-ubyte.gz'
TRAIN_LABELS = 'train-labels-idx1-ubyte.gz'
TEST_IMAGES = 't10k-images-idx3-ubyte.gz'
TEST_LABELS = 't10k-labels-idx1-ubyte.gz'
local_file=mnist_path + TRAIN_IMAGES with gfile.Open(local_file, 'rb') as f: train_images = extract_images(f)
local_file = mnist_path + TRAIN_LABELS with gfile.Open(local_file, 'rb') as f: train_labels = extract_labels(f, one_hot=one_hot)
local_file = mnist_path + TEST_IMAGES with gfile.Open(local_file, 'rb') as f: test_images = extract_images(f)
local_file = mnist_path + TEST_LABELS with gfile.Open(local_file, 'rb') as f: test_labels = extract_labels(f, one_hot=one_hot) `
when i try basic models, i get follow error.
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\yongquan.zhang\Downloads\Compressed\TensorFlow-Examples-master\examples\2_BasicModels\logistic_regression.py", line 16, in
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
File "C:\Python\Python36\lib\site-packages\tensorflow\python\util\deprecation.py", line 250, in new_func
return func(*args, kwargs)
File "C:\Python\Python36\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\mnist.py", line 260, in read_data_sets
source_url + TRAIN_IMAGES)
File "C:\Python\Python36\lib\site-packages\tensorflow\python\util\deprecation.py", line 250, in new_func
return func(*args, *kwargs)
File "C:\Python\Python36\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\base.py", line 252, in maybe_download
temp_filename, = urlretrieve_with_retry(source_url)
File "C:\Python\Python36\lib\site-packages\tensorflow\python\util\deprecation.py", line 250, in new_func
return func(args, kwargs)
File "C:\Python\Python36\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\base.py", line 205, in wrapped_fn
return fn(*args, *kwargs)
File "C:\Python\Python36\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\base.py", line 233, in urlretrieve_with_retry
return urllib.request.urlretrieve(url, filename)
File "C:\Python\Python36\lib\urllib\request.py", line 248, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "C:\Python\Python36\lib\urllib\request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "C:\Python\Python36\lib\urllib\request.py", line 526, in open
response = self._open(req, data)
File "C:\Python\Python36\lib\urllib\request.py", line 544, in _open
'_open', req)
File "C:\Python\Python36\lib\urllib\request.py", line 504, in _call_chain
result = func(args)
File "C:\Python\Python36\lib\urllib\request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "C:\Python\Python36\lib\urllib\request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。>