python - 深度学习课程:加载数据集时出错
问题描述
我想要一份 Andrew NG 的 Deepleaning 专业的 python 作业副本,并在我的本地机器上运行它们。我已经从这个存储库下载了作业 - https://github.com/amanchadha/coursera-deep-learning-specialization。
对于这个 jupyter 笔记本作业( >C4-Convolutional Neural Networks> Week 1> Convolution_model_Application_v1a.ipynb
),第一个单元格在我的计算机上工作正常,但第二个单元格
# Loading the data (signs)
X_train_orig, Y_train_orig, X_test_orig, Y_test_orig, classes = load_dataset()
给出以下错误-
--------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-2-6204c374be26> in <module>
1 # Loading the data (signs)
----> 2 X_train_orig, Y_train_orig, X_test_orig, Y_test_orig, classes = load_dataset()
~/Documents/Coursera Deep Learning/C4 - Convolutional Neural Networks/Week 1/cnn_utils.py in load_dataset()
7
8 def load_dataset():
----> 9 train_dataset = h5py.File('datasets/train_signs.h5', "r")
10 train_set_x_orig = np.array(train_dataset["train_set_x"][:]) # your train set features
11 train_set_y_orig = np.array(train_dataset["train_set_y"][:]) # your train set labels
~/anaconda3/lib/python3.8/site-packages/h5py/_hl/files.py in __init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, **kwds)
404 with phil:
405 fapl = make_fapl(driver, libver, rdcc_nslots, rdcc_nbytes, rdcc_w0, **kwds)
--> 406 fid = make_fid(name, mode, userblock_size,
407 fapl, fcpl=make_fcpl(track_order=track_order),
408 swmr=swmr)
~/anaconda3/lib/python3.8/site-packages/h5py/_hl/files.py in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
171 if swmr and swmr_support:
172 flags |= h5f.ACC_SWMR_READ
--> 173 fid = h5f.open(name, flags, fapl=fapl)
174 elif mode == 'r+':
175 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/h5f.pyx in h5py.h5f.open()
OSError: Unable to open file (file signature not found)
有人可以帮我解决这个问题吗?
解决方案
尝试单击https://github.com/amanchadha/coursera-deep-learning-specialization中的绿色按钮“代码”并一次性下载所有内容。然后重新加载 Jupyter Notebook。
我认为您没有下载目录“数据集”
推荐阅读
- python - How to perform a non recursive copy using python
- javascript - 哪种方法适合使用 React ref?
- javascript - 如何避免 IE 使用 javascript 重定向到自定义 404 页面
- r - 使用贝叶斯推理找出变量之间的关系
- java - 使用 CODE JAVA 生成带有 wsdl 的类,因为我跳过了证书
- dialogflow-es - 从谷歌上的操作中注销用户
- parsing - 如何管理bison中变量声明的语义规则
- sql - sybase脚本看不懂麻烦
- php - 上传文件后发送电子邮件
- android - 如何为android方法和类编写单元测试?