keras related issue
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 303
- PR merge metrics
- No merged PRs in 30d
Description
it was working fine, i maybe updated some dependencies or something and this issue started
2024-05-24 16:42:44.507092: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with
the appropriate compiler flags.
Traceback (most recent call last):
File "d:\Desktop\codes\mobilenet_v2_140_224\try.py", line 94, in
main()
File "d:\Desktop\codes\mobilenet_v2_140_224\try.py", line 78, in main
model = load_model(model_path)
^^^^^^^^^^^^^^^^^^^^^^
File "d:\Desktop\codes\mobilenet_v2_140_224\try.py", line 49, in load_model
model = tf.keras.models.load_model(model_path, custom_objects={'KerasLayer': KerasLayerWrapper})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Mobipixels10\AppData\Roaming\Python\Python311\site-packages\keras\src\saving\saving_api.py", line 183, in load_model
return legacy_h5_format.load_model_from_hdf5(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Mobipixels10\AppData\Roaming\Python\Python311\site-packages\keras\src\legacy\saving\legacy_h5_format.py", line 133, in load_model_from_hdf5
model = saving_utils.model_from_config(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Mobipixels10\AppData\Roaming\Python\Python311\site-packages\keras\src\legacy\saving\saving_utils.py", line 85, in model_from_config
return serialization.deserialize_keras_object(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Mobipixels10\AppData\Roaming\Python\Python311\site-packages\keras\src\legacy\saving\serialization.py", line 495, in deserialize_keras_object
deserialized_obj = cls.from_config(
^^^^^^^^^^^^^^^^
File "C:\Users\Mobipixels10\AppData\Roaming\Python\Python311\site-packages\keras\src\models\sequential.py", line 342, in from_config
model.add(layer)
File "C:\Users\Mobipixels10\AppData\Roaming\Python\Python311\site-packages\keras\src\models\sequential.py", line 95, in add
raise ValueError(
ValueError: Only instances of `keras.Layer` can be added to a Sequential model. Received: <__main__.load_model..KerasLayerWrapper object at 0x000001C99B2B4910> (of type .KerasLayerWrapper'>)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by inspecting the reported try.py load_model function and its KerasLayerWrapper, then reproduce the failure with the dependency versions that trigger it. The reported done state is loading the model without the keras.Layer ValueError, but the issue does not identify a repository file, test, or expected compatibility target.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- keras, python, tensorflow
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100