Skip to content
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

problem with recent keras library #1

Open
eroux opened this issue Sep 22, 2024 · 1 comment
Open

problem with recent keras library #1

eroux opened this issue Sep 22, 2024 · 1 comment

Comments

@eroux
Copy link
Contributor

eroux commented Sep 22, 2024

I'm getting

2024-09-22 12:27:06.399885: 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.
2024-09-22 12:27:07.642666: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/ops/operation.py", line 234, in from_config
    return cls(**config)
           ^^^^^^^^^^^^^
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/layers/convolutional/separable_conv2d.py", line 122, in __init__
    super().__init__(
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/layers/convolutional/base_separable_conv.py", line 104, in __init__
    super().__init__(
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/layers/layer.py", line 285, in __init__
    raise ValueError(
ValueError: Unrecognized keyword arguments passed to SeparableConv2D: {'groups': 1, 'kernel_initializer': {'class_name': 'GlorotUniform', 'config': {'seed': None}}, 'kernel_regularizer': None, 'kernel_constraint': None}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/admin/nlm-numbers-model/nlm_classifier_infer.py", line 24, in <module>
    MODEL = keras.models.load_model(model_file)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/saving/saving_api.py", line 194, in load_model
    return legacy_h5_format.load_model_from_hdf5(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/legacy/saving/legacy_h5_format.py", line 133, in load_model_from_hdf5
    model = saving_utils.model_from_config(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/legacy/saving/saving_utils.py", line 85, in model_from_config
    return serialization.deserialize_keras_object(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/legacy/saving/serialization.py", line 495, in deserialize_keras_object
    deserialized_obj = cls.from_config(
                       ^^^^^^^^^^^^^^^^
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/models/model.py", line 525, in from_config
    return functional_from_config(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/models/functional.py", line 477, in functional_from_config
    process_layer(layer_data)
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/models/functional.py", line 457, in process_layer
    layer = saving_utils.model_from_config(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/legacy/saving/saving_utils.py", line 85, in model_from_config
    return serialization.deserialize_keras_object(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/legacy/saving/serialization.py", line 504, in deserialize_keras_object
    deserialized_obj = cls.from_config(cls_config)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/pvenv/lib/python3.11/site-packages/keras/src/ops/operation.py", line 236, in from_config
    raise TypeError(
TypeError: Error when deserializing class 'SeparableConv2D' using config={'name': 'separable_conv2d', 'trainable': True, 'dtype': 'float32', 'filters': 256, 'kernel_size': [3, 3], 'strides': [1, 1], 'padding': 'same', 'data_format': 'channels_last', 'dilation_rate': [1, 1], 'groups': 1, 'activation': 'linear', 'use_bias': True, 'kernel_initializer': {'class_name': 'GlorotUniform', 'config': {'seed': None}}, 'bias_initializer': {'class_name': 'Zeros', 'config': {}, 'shared_object_id': 14}, 'kernel_regularizer': None, 'bias_regularizer': None, 'activity_regularizer': None, 'kernel_constraint': None, 'bias_constraint': None, 'depth_multiplier': 1, 'depthwise_initializer': {'class_name': 'GlorotUniform', 'config': {'seed': None}}, 'pointwise_initializer': {'class_name': 'GlorotUniform', 'config': {'seed': None}}, 'depthwise_regularizer': None, 'pointwise_regularizer': None, 'depthwise_constraint': None, 'pointwise_constraint': None}.

Exception encountered: Unrecognized keyword arguments passed to SeparableConv2D: {'groups': 1, 'kernel_initializer': {'class_name': 'GlorotUniform', 'config': {'seed': None}}, 'kernel_regularizer': None, 'kernel_constraint': None}

with tensorflow 2.17.0 / keras 3.5.0

@eroux
Copy link
Contributor Author

eroux commented Sep 22, 2024

works with Tensorflow 2.13.0 / keras 2.13.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant