question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

When I run this sample Usage

import numpy as np
from PIL import Image

img = Image.open(r'MyJPG_Path')
lr_img = np.array(img)

from ISR.models import RDN

rdn = RDN(arch_params={'C':6, 'D':20, 'G':64, 'G0':64, 'x':2})
rdn.model.load_weights('weights/sample_weights/rdn-C6-D20-G64-G064-x2/ArtefactCancelling/rdn-C6-D20-G64-G064-x2_ArtefactCancelling_epoch219.hdf5')
sr_img = rdn.predict(lr_img)
Image.fromarray(sr_img)

It warns that:

Traceback (most recent call last):
  File "test.py", line 12, in <module>
    rdn.model.load_weights('weights/sample_weights/rdn-C6-D20-G64-G064-x2/ArtefactCancelling/rdn-C6-D20-G64-G064-x2_ArtefactCancelling_epoch219.hdf5')
  File "lib\site-packages\keras\engine\network.py", line 1157, in load_weights
    with h5py.File(filepath, mode='r') as f:
  File "lib\site-packages\h5py\_hl\files.py", line 394, in __init__
    swmr=swmr)
  File "lib\site-packages\h5py\_hl\files.py", line 170, 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 85, in h5py.h5f.open
OSError: Unable to open file (file signature not found)

I use the original hdf5 file which is downloaded from the Github source. I wonder how to cope with this problem.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

6reactions
pldeepeshcommented, Oct 9, 2019

@cfrancesco I have tried to use git lfs pull but it throws an errror,

batch response: This repository is over its data quota. Purchase more data packs to restore access. error: failed to fetch some objects from 'https://github.com/idealo/image-super-resolution.git/info/lfs'

0reactions
joys8998commented, Apr 2, 2020

Yeps, but the amount of images is quite huge and it chashes if i use a for cycle ( also in colab) anyway thank you for your support 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error opening file in H5PY (File signature not found)
Usually the message File signature not found indicates either: 1. Your file is corrupted. ... is what I think is most likely. You...
Read more >
OSError: Unable to open file (File signature not found) #757
@mas-dse-greina the message File signature not found suggests the file is either corrupted or not in the HDF5 format. Be aware that all ......
Read more >
OSError: Unable to open file (file signature not found) - Streamlit
OSError : Unable to open file (file signature not found). Traceback:
Read more >
OSError: Unable to open file (file signature not found)
OSError: Invalid decryption. Unable to open file (file signature not found). The key used to load the model is incorrect.
Read more >
Error opening file in H5PY (File signature not found)
I've been using the following bit of code to open some HDF5 files, produced in MATLAB, ... OSError: Unable to open file (File...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found