-
Notifications
You must be signed in to change notification settings - Fork 19.4k
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
ValueError: Unable to create group (Name already exists) while model.save() #6005
Comments
Updating h5py worked for me. I'm using Keras 2.0.1, python 3.5. |
@MarcoForte That's good that it helped you, but I already have all the latest versions. I forgot to say that I'm using Anaconda with Python 3.6. |
@Dragonblf same issue, very strange bug |
I had the same issue but was able to find the problem. What happened to me was that I assign a layer to a variable, eg. lstm_layer = LSTM(num_cells...), and repeatedly adding the same layer to a sequential model. I solved it by initializing a new layer each time I want to add the same layer. Hope this helps! |
@seanzzz what exactly do you mean? Can you give a quick code sample? |
When you add layers and activations, you can either add them directly or as an instance:
This version will cause problems with a model_checkpoint. I assume that the checkpoint writes the weights into a column named "leaky" and since there are two with the exact same name, it gets confused. What you can do is this:
|
Thanks. It worked. I was facing similar issues. |
The workaround is great, but it is still an issue. |
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. |
try to use |
this works for me model.save_weights('a.h5') # value error
for i in range(len(model.weights)):
model.weights[i]._handle_name = model.weights[i].name + "_" + str(I)
model.save_weights('a.h5') # OK, saved. |
Hey,
Every time I try to save my model (architecture and weights) I get an error.
I used the command: 'model.save('savepath')' and the ModelCheckpoint Callback funtcion, but at both I get this error message:
File "C:\Users\User\Downloads\Anaconda\lib\site-packages\keras\models.py", line 109, in save_model: topology.save_weights_to_hdf5_group(model_weights_group, model_layers)
File "C:\Users\User\Downloads\Anaconda\lib\site-packages\keras\engine\topology.py", line 2708, in save_weights_to_hdf5_group: g = f.create_group(layer.name)
File "C:\Users\User\Downloads\Anaconda\lib\site-packages\h5py\_hl\group.py", line 52, in create_group: gid = h5g.create(self.id, name, lcpl=lcpl)
File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (C:\Minonda\conda-bld\h5py_1490030958306\work\h5py\_objects.c:2867)
File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (C:\Minonda\conda-bld\h5py_1490030958306\work\h5py\_objects.c:2825)
File "h5py\h5g.pyx", line 151, in h5py.h5g.create (C:\Minonda\conda-bld\h5py_1490030958306\work\h5py\h5g.c:2851)
ValueError: Unable to create group (Name already exists)
Does anyone know how I can fix the problem?
The text was updated successfully, but these errors were encountered: