AlexMa123 / DCNN-SHHS

The supplementary material for the paper: Automatic sleep-stage classification of heart rate and actigraphy data using deep and transfer learning approaches
5 stars 1 forks source link

downloaded demo file is corrupt #2

Closed KoyaS closed 2 weeks ago

KoyaS commented 3 weeks ago

i'm on mac so i had to download this file with curl:

!curl -L "https://onedrive.live.com/download?cid=45D5A10F94E33861&resid=45D5A10F94E33861%21248707&authkey=AKRa5kb3XFj4G-o" -o shhs_dataset.h5

and when i try to open it:

shhs_dataset = h5py.File("./shhs_dataset.h5", 'r')

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[5], [line 1](vscode-notebook-cell:?execution_count=5&line=1)
----> [1](vscode-notebook-cell:?execution_count=5&line=1) shhs_dataset = h5py.File("./shhs_dataset.h5", 'r')
      [3](vscode-notebook-cell:?execution_count=5&line=3) # where the RRI are saved
      [4](vscode-notebook-cell:?execution_count=5&line=4) shhs_dataset['rri']

File /opt/miniconda3/lib/python3.12/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](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:553)     fapl = make_fapl(driver, libver, rdcc_nslots, rdcc_nbytes, rdcc_w0,
    [554](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:554)                      locking, page_buf_size, min_meta_keep, min_raw_keep,
    [555](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:555)                      alignment_threshold=alignment_threshold,
    [556](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:556)                      alignment_interval=alignment_interval,
    [557](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:557)                      meta_block_size=meta_block_size,
    [558](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:558)                      **kwds)
    [559](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:559)     fcpl = make_fcpl(track_order=track_order, fs_strategy=fs_strategy,
    [560](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:560)                      fs_persist=fs_persist, fs_threshold=fs_threshold,
    [561](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:561)                      fs_page_size=fs_page_size)
--> [562](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:562)     fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
    [564](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:564) if isinstance(libver, tuple):
    [565](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:565)     self._libver = libver

File /opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:235, in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
    [233](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:233)     if swmr and swmr_support:
    [234](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:234)         flags |= h5f.ACC_SWMR_READ
--> [235](https://file+.vscode-resource.vscode-cdn.net/opt/miniconda3/lib/python3.12/site-packages/h5py/_hl/files.py:235)     fid = h5f.open(name, flags, fapl=fapl)
...
File h5py/_objects.pyx:55, in h5py._objects.with_phil.wrapper()

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

OSError: Unable to open file (file signature not found)
KoyaS commented 3 weeks ago

upon further investigation it appears that the file contents is not an hd5 file but instead a blocked request:

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta content='text/html; charset=utf-8' http-equiv='content-type'/><style type='text/css'>body { font-family:Arial; margin-left:40px; }img  { border:0 none; }#content { margin-left: auto; margin-right: auto }#message h2 { font-size: 20px; font-weight: normal; color: #000000; margin: 34px 0px 0px 0px }#message p  { font-size: 13px; color: #000000; margin: 7px 0px 0px 0px }#errorref { font-size: 11px; color: #737373; margin-top: 41px }</style><title>Microsoft</title></head><body><div id='content'><div id='message'><h2>The request is blocked.</h2></div><div id='errorref'><span>Ref A: 27F7B8FDCF174B729DAD192DD67D6E91 Ref B: BN3EDGE0616 Ref C: 2024-10-02T18:00:42Z</span></div></div></body></html>

could this link have expired and if so could i get a new one?

AlexMa123 commented 2 weeks ago

The simplest solution is to copy https://onedrive.live.com/download?cid=45D5A10F94E33861&resid=45D5A10F94E33861%21248707&authkey=AKRa5kb3XFj4G-o and paste it into your web browser; this way, you can download the dataset.