# Error while reading datasets using h5py module

**URL:** <https://dlai.staged-by-discourse.com/t/error-while-reading-datasets-using-h5py-module/478714>\
**Category:** Improving Deep Neural Networks: Hyperparameter tun\
**Tags:** coursera-platform\
**Created:** [October 27, 2023, 12:20pm UTC](https://dlai.staged-by-discourse.com/t/error-while-reading-datasets-using-h5py-module/478714 "2023-10-27T12:20:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ujjwal\_Pandey](https://avatars.discourse-cdn.com/v4/letter/u/258eb7/32.png) [@Ujjwal\_Pandey](https://dlai.staged-by-discourse.com/u/Ujjwal_Pandey)\
**Post date:** [October 27, 2023, 12:20pm UTC](https://dlai.staged-by-discourse.com/t/error-while-reading-datasets-using-h5py-module/478714/1 "2023-10-27T12:20:11Z")

</div>

```auto
Cell In[3], line 1
----> 1 train_dataset = h5py.File('datasets/train_signs.h5', "r")
      2 test_dataset = h5py.File('datasets/test_signs.h5', "r")

File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\h5py\_hl\files.py:562, in File. __init__ (self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, fs_strategy, fs_persist, fs_threshold, fs_page_size, page_buf_size, min_meta_keep, min_raw_keep, locking, alignment_threshold, alignment_interval, meta_block_size, **kwds)
    553 fapl = make_fapl(driver, libver, rdcc_nslots, rdcc_nbytes, rdcc_w0,
    554 locking, page_buf_size, min_meta_keep, min_raw_keep,
    555 alignment_threshold=alignment_threshold,
    556 alignment_interval=alignment_interval,
    557 meta_block_size=meta_block_size,
    558 **kwds)
    559 fcpl = make_fcpl(track_order=track_order, fs_strategy=fs_strategy,
    560 fs_persist=fs_persist, fs_threshold=fs_threshold,
    561 fs_page_size=fs_page_size)
--> 562 fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
    564 if isinstance(libver, tuple):
    565 self._libver = libver

File ~\AppData\Local\Programs\Python\Python311\Lib\site-packages\h5py\_hl\files.py:235, in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
    233 if swmr and swmr_support:
    234 flags |= h5f.ACC_SWMR_READ
--> 235 fid = h5f.open(name, flags, fapl=fapl)
    236 elif mode == 'r+':
    237 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)

File h5py\_objects.pyx:54, in h5py._objects.with_phil.wrapper()

File h5py\_objects.pyx:55, in h5py._objects.with_phil.wrapper()

File h5py\h5f.pyx:102, in h5py.h5f.open()

OSError: Unable to synchronously open file (file signature not found)

```

---

<div class="post-metadata">

**Author:** ![Nydia](https://avatars.discourse-cdn.com/v4/letter/n/c57346/32.png) [@Nydia](https://dlai.staged-by-discourse.com/u/Nydia)\
**Post date:** [October 27, 2023, 12:41pm UTC](https://dlai.staged-by-discourse.com/t/error-while-reading-datasets-using-h5py-module/478714/2 "2023-10-27T12:41:05Z")

</div>

Hi,  
Please specify the course, week and notebook your are referring to so that we can properly help you

---

<div class="post-metadata">

**Author:** ![Ujjwal\_Pandey](https://avatars.discourse-cdn.com/v4/letter/u/258eb7/32.png) [@Ujjwal\_Pandey](https://dlai.staged-by-discourse.com/u/Ujjwal_Pandey)\
**Post date:** [October 27, 2023, 12:59pm UTC](https://dlai.staged-by-discourse.com/t/error-while-reading-datasets-using-h5py-module/478714/3 "2023-10-27T12:59:12Z")

</div>

course 2 week 3 of deep learning specialization  
notebook: tensorflow introduction

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlaistaging/user_avatar/dlai.staged-by-discourse.com/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://dlai.staged-by-discourse.com/u/paulinpaloalto)\
**Post date:** [October 27, 2023, 3:56pm UTC](https://dlai.staged-by-discourse.com/t/error-while-reading-datasets-using-h5py-module/478714/4 "2023-10-27T15:56:22Z")

</div>

Are you running the notebooks on the Coursera website or on your local computer? If the latter, there are a lot of things you have to arrange first, including downloading not just the notebook but all the accompanying files. See [this thread](http://dlai.staged-by-discourse.com/t/downloading-entire-assignment/122407/2) for instructions. You also have issues to worry about w.r.t. the versions of various packages being different than they are in the course environment.
