Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Load the Weights #11

Open
zhipeng-fan opened this issue Oct 22, 2017 · 3 comments
Open

Can't Load the Weights #11

zhipeng-fan opened this issue Oct 22, 2017 · 3 comments

Comments

@zhipeng-fan
Copy link

Hi! I am new to this project and Keras. I have downloaded the weights file from the dropbox into /model/keras/model.h5. However, I kept getting this error:

$ python demo_image.py --image sample_images/ski.jpg
Using TensorFlow backend.
start processing...
Traceback (most recent call last):
File "demo_image.py", line 245, in
model.load_weights(keras_weights_file)
File "/home/zf606/miniconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 2613, in load_weights
f = h5py.File(filepath, mode='r')
File "/home/zf606/miniconda3/lib/python3.6/site-packages/h5py/_hl/files.py", line 271, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/home/zf606/miniconda3/lib/python3.6/site-packages/h5py/_hl/files.py", line 101, 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 78, in h5py.h5f.open
OSError: Unable to open file (Unable to lock file, errno = 5, error message = 'input/output error')

Any ideas on how to fix this?

@michalfaber
Copy link
Owner

@zhipeng-fan It seems that there is a problem with opening the file. "....Unable to lock file" Check file access permissions on your machine.

@zhipeng-fan
Copy link
Author

@michalfaber Yeah. It could run on my own laptop but not the cluster. I guess it is the permission problems. Thanks any way! Great job to transfer the original work into Keras!

@QiLiaoDE
Copy link

QiLiaoDE commented Oct 25, 2017

@michalfaber

Hi Michal,

I also came across some problem with load_weights() using the downloaded file from the dropbox /model/keras/model.h5
The error I got is as follows:

ValueError: Dimension 0 in both shapes must be equal, but are 1 and 38 for 'Assign_140' (op: 'Assign') with input shapes: [1,1,128,19], [38,128,1,1].

And my kerns.json is set to

{
"epsilon": 1e-07,
"floatx": "float32",
"image_data_format": "channels_last",
"backend": "tensorflow"
}

Any suggestions? Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants