我是一个深入学习的新手,我只是在做我的第一步。我有一个MacBook Pro 2017模型,我正在尝试使用逻辑回归来运行MNIST dataset。当我运行官方深度学习网站上提到的示例代码时,我收到以下错误。。在
<i>Downloading data from http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist.pkl.gz
Traceback (most recent call last):
File "/Users/abi/PycharmProjects/LogisticRgr_test/logist_test.py", line 475, in <module>
sgd_optimization_mnist()
File "/Users/abi/PycharmProjects/LogisticRgr_test/logist_test.py", line 277, in sgd_optimization_mnist
datasets = load_data(dataset)
File "/Users/abi/PycharmProjects/LogisticRgr_test/logist_test.py", line 205, in load_data
urllib.request.urlretrieve(origin, dataset)
File "/Users/abi/miniconda2/lib/python2.7/urllib.py", line 98, in urlretrieve
return opener.retrieve(url, filename, reporthook, data)
File "/Users/abi/miniconda2/lib/python2.7/urllib.py", line 249, in retrieve
tfp = open(filename, 'wb')
IOError: [Errno 2] No such file or directory: '/Users/abi/PycharmProjects/LogisticRgr_test/../data/mnist.pkl.gz'
Process finished with exit code 1</i>
如文件物流所述_新加坡元http://deeplearning.net/tutorial/code/logistic_sgd.py
首先,您可以在http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist.pkl.gz上手动下载此文件 添加文件'mnist.pkl.gz版'到当前目录,因为函数首先检查mnist文件是否在data目录中。如果你这样做,那么检查是否安装了numpy和一切正常。在
urllib.request.urlretrieve(origin, dataset)
对我也不起作用,但是你只要下载文件,我就做了一些修改^{pr2}$
然后调用下载函数
^{3}$在这些更改之后,load_data函数对我很好
我又做了些调查:
替换此语句:
声明如下:
从urlretrieve中获取一个元组,并从必须在gzip.open声明!在
相关问题 更多 >
编程相关推荐