Keras: Cannot save model!

Created on 15 May 2017  路  8Comments  路  Source: keras-team/keras

Traceback (most recent call last):
File "W:/Nutstore_Lab/5-13/Code/ReducingDimensions_CAE.py", line 47, in
autoencoder.save(filepath=r"W:/tmp/autoencoder5-13/model_ae16.h5")
File "S:\Python35\lib\site-packages\keras\engine\topology.py", line 2472, in save
save_model(self, filepath, overwrite, include_optimizer)
File "S:\Python35\lib\site-packages\keras\models.py", line 97, in save_model
f = h5py.File(filepath, 'w')
File "S:\Python35\lib\site-packages\h5py_hlfiles.py", line 271, in __init__
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "S:\Python35\lib\site-packages\h5py_hlfiles.py", line 107, in make_fid
fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl)
File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (D:\Build\h5py\h5py-2.7.0\h5py_objects.c:2853)
File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (D:\Build\h5py\h5py-2.7.0\h5py_objects.c:2811)
File "h5py\h5f.pyx", line 98, in h5py.h5f.create (D:\Build\h5py\h5py-2.7.0\h5py\h5f.c:2297)
OSError: Unable to create file (Unable to open file: name = 'w:/tmp/autoencoder5-13/model_ae16.h5', errno = 2, error message = 'no such file or directory', flags = 13, o_flags = 302)

stale

Most helpful comment

Your error seems to be clear: OSError: Unable to create file. You have to create the folder w:/tmp/autoencoder5-13/.

All 8 comments

Does there exist a folder named autoencoder5-13?

I got the same error message as above when i set the backprop_modifier as 'guided' for visulaising saliency. Please let me know what is the reason for this error

Your error seems to be clear: OSError: Unable to create file. You have to create the folder w:/tmp/autoencoder5-13/.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.

w:/tmp/autoencoder5-13/

Can you please explain how to create folder?

Either manually create that folder or with :

import os
path = "w:/tmp/autoencoder5-13/"
os.mkdir(path)

errno = 2, error message = 'No such file or directory', flags = 13, o_flags = 242
I got similar error above when I set save_weights_only=False in tf.keras.callbacks.ModelCheckpoint.
And my code would run perfectly when set save_weights_only=True, but I won't get the ckpt.meta file

i am getting this error what i do
Traceback (most recent call last):
File "C:\stage_1_gan.py", line 453, in
stage1_gen.save_weights("stage1_gen.h5")
File "C:\Users\HP\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\network.py", line 1414, in save_weights
with h5py.File(filepath, 'w') as f:
File "C:\Users\HP\Anaconda3\lib\site-packages\h5py_hlfiles.py", line 394, in __init__
swmr=swmr)
File "C:\Users\HP\Anaconda3\lib\site-packages\h5py_hlfiles.py", line 176, in make_fid
fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl)
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 105, in h5py.h5f.create
OSError: Unable to create file (unable to open file: name = 'stage1_gen.h5', errno = 13, error message = 'Permission denied', flags = 13, o_flags = 302)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

snakeztc picture snakeztc  路  3Comments

zygmuntz picture zygmuntz  路  3Comments

MarkVdBergh picture MarkVdBergh  路  3Comments

LuCeHe picture LuCeHe  路  3Comments

somewacko picture somewacko  路  3Comments