我想要一份 Andrew NG 的 Deepleaning 专业的 Python 作业副本,并在我的本地机器上运行它们。我已经从这个存储库下载了作业 - https://github.com/amanchadha/coursera-deep-learning-specialization。
对于 this jupyter notebook assignment (>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)
有人可以帮我解决这个问题吗?
答案 0 :(得分:0)
尝试点击 https://github.com/amanchadha/coursera-deep-learning-specialization 中的绿色按钮“代码”并一次性下载所有内容。然后重新加载 Jupyter Notebook。
我认为您没有下载“数据集”目录