CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Accessing MNIST data

Open rashee182 opened this issue 10 years ago • 2 comments

I am observing issues in trying to pull the MNIST data using the python script provided with example. I can access the url "http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz" and download this package otherwise. But the python script is throwing this error

python mnist_convert.py Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz Traceback (most recent call last): File "mnist_convert.py", line 56, in trnData = loadData('http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz', 60000) File "mnist_convert.py", line 12, in loadData gzfname, h = urllib.urlretrieve(src) File "C:\Python27\lib\urllib.py", line 98, in urlretrieve return opener.retrieve(url, filename, reporthook, data) File "C:\Python27\lib\urllib.py", line 245, in retrieve fp = self.open(url, data) File "C:\Python27\lib\urllib.py", line 213, in open return getattr(self, name)(url) File "C:\Python27\lib\urllib.py", line 350, in open_http h.endheaders(data) File "C:\Python27\lib\httplib.py", line 1053, in endheaders self._send_output(message_body) File "C:\Python27\lib\httplib.py", line 897, in _send_output self.send(msg) File "C:\Python27\lib\httplib.py", line 859, in send self.connect() File "C:\Python27\lib\httplib.py", line 836, in connect self.timeout, self.source_address) File "C:\Python27\lib\socket.py", line 575, in create_connection raise err IOError: [Errno socket error] [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

rashee182 avatar May 17 '16 00:05 rashee182

Hello, Is this happening every time you run the script? Unfortunately, I cannot reproduce it on my end - the script works fine. As a workaround, you can download the files yourself and change appropriate functions in the script, loadData and loadLabels. These functions are very simple, you would only need to disable downloading itself and change file names (use original file names instead of delete.me).

Alexey-Kamenev avatar May 17 '16 16:05 Alexey-Kamenev

Thanks ! That tip helped. I am now downloading the data separately and using the script just for conversion to cntk format

rashee182 avatar May 19 '16 01:05 rashee182