Keras load_model command error : 'NoneType' object has no attribute 'get'
See original GitHub issuePlease 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 on the Keras Slack channel instead of opening 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
-
Check that your version of TensorFlow is up-to-date. The installation instructions can be found here.
-
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:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
'NoneType' object has no attribute 'get' ) while loading saved ...
This error can be caused by having custom logic in your model, and not providing the custom logic in the custom_objects arguments when ......
Read more >How to Save and Load Your Keras Deep Learning Model
Keras is a simple and powerful Python library for deep learning. ... “AttributeError: 'KerasClassifier' object has no attribute 'save'”.
Read more >Error AttributeError: 'NoneType' object has no attribute ...
My model is as follows: embed_dim = 16 vocab_size = vocab.num_words np_text_tensor = np.array(text_tensor_train) print(np_text_tensor.shape)
Read more >Saving and Loading Tensorflow Model Results in Keras Error
I get the following error message. File "sampleModel.py", line 342, in <module> model = tf.keras.models.
Read more >'sequential' object has no attribute 'score' - You.com - You.com
tensorflow\python\keras\engine\sequential.py:455: UserWarning: model.predict_classes() is deprecated and will be removed after 2021-01-01. Please use instead:* ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In case it helps anyone else having this issue: my solution was to use the
custom_objects
argument ofkeras.model.load_model
to provide a dictionary of custom objects/functions, including the function used within my Lambda layer. Model loads fine now.In model definition:
Later, when loading the same model:
I’m having this issue after updating keras to 2.2.4. I have a python lambda function at my loss function, and using “load_model” with argument “custom_objects” won’t help. I was wondering if there is any other ways to deal with this issue besides only saving weights (discard the model structure).