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.

Not able to import saving

See original GitHub issue

I’m trying to use Intel NLP Architect and its example has this line that makes it not working:

>>> from keras.engine import saving
Using TensorFlow backend.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'saving'

Anyone knows how to fix it? Thank you! Also this is a link to the whole framework: http://nlp_architect.nervanasys.com/ner_crf.html But the line that makes it not working is just that one line.

========================================================================

Please make sure that the boxes below are checked before you submit your issue. If your issue is an implementation question, please ask your question on StackOverflow or join the Keras Slack channel and ask there instead of filing a GitHub issue.

Thank you!

  • Check that you are up-to-date with the master branch of Keras. You can update with: pip install git+git://github.com/keras-team/keras.git --upgrade --no-deps

  • If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found here.

  • If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with: pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps

  • Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

17reactions
albavilanovacommented, Jul 11, 2020

It is super late but I want to give the solution in case somebody is still looking for it.

I am using Keras (2.1.3) and Tensorflow (1.3.0) and I saw that the developers rewrote the word saving as topology.

Therefore, in order to make it work, you need to modify (in your model file of …\site-packages\mrcnn) this:

From:

from keras.engine import saving

To:

from keras.engine import topology

And from:

if by_name: saving.load_weights_from_hdf5_group_by_name(f, layers)

else: saving.load_weights_from_hdf5_group(f, layers)

To:

if by_name: topology.load_weights_from_hdf5_group_by_name(f, layers)

else: topology.load_weights_from_hdf5_group(f, layers)

1reaction
RaphaelMeudeccommented, May 30, 2018

Hi!

It seems the saving file in keras.engine has been initialized after the last release of keras (2.1.6 – relevant commit).

You can either:

  • wait for the next release
  • directly clone the repo in your site-packages and run the install there.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve "Out of Memory" message when trying to import/save ...
If you believe you have enough RAM to save/import/export the file, reboot the computer to defragment the memory, close down as many running...
Read more >
Access gives an error when trying to save import steps
I am importing an Excel table into Access and I want to save the import steps so I can easily re-run the import...
Read more >
Unable to Import, Save or Export in CorelDraw Graphics Suite ...
Two days ago I was no longer able to import / export / save or save as any files in CorelDraw. I can...
Read more >
Unable to Import Passwords From Chrome - Mozilla Support
The wizard finishes saying that it successfully imported saved logins and passwords, but nothing shows up in the password manager.
Read more >
Why am I not able to import/export in certain file formats ...
Why am I not able to import/export in certain file formats although they appear in the save as list? DesignSpark Mechanical.
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