Keras: unrecognized keyword arguments

See original GitHub issue

When running the example code from the keras section, the following error occurs:

Traceback (most recent call last):
  File "/home/pi/Documents/converted_keras/TMexample.py", line 7, in <module>
    model = tensorflow.keras.models.load_model('/home/pi/Documents/converted_keras/keras_model.h5')
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/save.py", line 137, in load_model
    return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 162, in load_model_from_hdf5
    custom_objects=custom_objects)
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/model_config.py", line 55, in model_from_config
    return deserialize(config, custom_objects=custom_objects)
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/layers/serialization.py", line 97, in deserialize
    printable_module_name='layer')
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/generic_utils.py", line 191, in deserialize_keras_object
    list(custom_objects.items())))
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/sequential.py", line 358, in from_config
    custom_objects=custom_objects)
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/layers/serialization.py", line 97, in deserialize
    printable_module_name='layer')
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/generic_utils.py", line 191, in deserialize_keras_object
    list(custom_objects.items())))
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/sequential.py", line 358, in from_config
    custom_objects=custom_objects)
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/layers/serialization.py", line 97, in deserialize
    printable_module_name='layer')
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/generic_utils.py", line 191, in deserialize_keras_object
    list(custom_objects.items())))
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/network.py", line 1130, in from_config
    process_layer(layer_data)
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/network.py", line 1114, in process_layer
    layer = deserialize_layer(layer_data, custom_objects=custom_objects)
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/layers/serialization.py", line 97, in deserialize
    printable_module_name='layer')
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/generic_utils.py", line 193, in deserialize_keras_object
    return cls.from_config(cls_config)
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 456, in from_config
    return cls(**config)
  File "/home/pi/.local/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/input_layer.py", line 81, in __init__
    raise ValueError('Unrecognized keyword arguments:', kwargs.keys())
ValueError: ('Unrecognized keyword arguments:', dict_keys(['ragged']))

Any guidance on how to get the model running?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
zxsq-cccommented, Nov 20, 2019

I also missed an image = before `image.resize’, running now to see if that fixed it.

e: oh, haha, that was the fix in 53! It ran fine now.

0reactions
HalfdanJcommented, Nov 20, 2019

I think was just solved in this pr: https://github.com/googlecreativelab/teachablemachine-community/pull/53 Small tweak to the code snippet

Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueError: ('Unrecognized keyword arguments:', dict_keys ...
I'm trying to load keras model using ...
Read more >
('Unrecognized keyword arguments:', dict_keys(['input_dtype ...
@ArkajyotiChakraborty a likely cause for this is the wrong version of dependencies, or wrong Keras backend. I'd check these two: the versions of ......
Read more >
ValueError: ('Unrecognized keyword arguments:', dict_keys ...
I'm trying to load keras model using the code snippet below: from tensorflow import keras from PIL import Image, ImageOps import numpy as...
Read more >
Model trained by Google Colab cannot run in Donkey Car
Today I am running my colab notebook to train the model for donkey car and notice that the default tensorflow runtime has been...
Read more >
ValueError: ('Unrecognized keyword arguments:', dict_keys ...
[TOC](解决"ValueError: ('Unrecognized keyword arguments:', dict_keys(['ragged'])")报错如下解决方法将tensorflow升级到2.3.0版本即可!
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