Skip to content

OSError: Unable to open file (file signature not found) #4

Open

Description

@tashrifbillah

Hi Vishnu (@vishnubashyam), did you upload the proper Models/DBN_model.h5 file to GitHub? I have been helping one of our RAs to install it and Python complained as follows when we tried Script/test.sh:

  File "py3-akb67/envs/akb67-deepbrain/lib/python3.6/site-packages/h5py/_hl/files.py", line 190, in make_fid
    fid = h5f.open(name, flags, fapl=fapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5f.pyx", line 96, in h5py.h5f.open
OSError: Unable to open file (file signature not found)

In my experience, h5 files are big and are circulated through GitHub release or Google Drive share.

Activity

  1. DVSneuro commented on Apr 11, 2024

    @DVSneuro

    Hi @tashrifbillah -- not sure if you ever stumbled across a solution here, but I think the h5 files are on Box (https://upenn.app.box.com/v/DeepBrainNet). However, I still get the error below when using any of those h5 files:

    ValueError: Layer count mismatch when loading weights from file. Model expected 1 layers, found 3 saved layers.

  2. tashrifbillah commented on Apr 11, 2024

    @tashrifbillah
    Author

    The RA left our office. So I never got to work on it anymore. Sorry!

  3. DVSneuro commented on Apr 12, 2024

    @DVSneuro

    No worries! If you ever get back to it, @tannerjared has a nice fork of this repo with some fixes and more documentation (https://github.com/tannerjared/DeepBrainNet).

    I still got the ValueError above, but it appears to be resolved by downgrading to tensorflow==2.15.

  4. tannerjared commented on Apr 12, 2024

    @tannerjared

    That's good feedback @DVSneuro about the working version of tensorflow. I want to add that @mateuszpawlik has a containerized version of this implemented in Nextflow

    I haven't finished comparisons yet between this version and the containerized versions, but it's worth a look. It's a lovely, much more automated approach.

  5. DVSneuro commented on Apr 12, 2024

    @DVSneuro

    Good to know, thanks!

  6. boss477 commented on Oct 7, 2026

    @boss477

    I updated #10 with README troubleshooting for this error. The FAQ now notes that \OSError: Unable to open file (file signature not found)\ usually means the downloaded file is not the real HDF5 payload, so users should re-download from the Box page and verify file size, then use a compatible legacy TensorFlow/Keras environment if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions