Exception encountered: Unrecognized keyword arguments: [‘batch_shape’]

when i tried to load keras model, i encountered this weird error:

here is my code:

model = tf.keras.models.load_model('/kaggle/input/iyntmodel/vgg19.keras')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
File /opt/conda/lib/python3.10/site-packages/keras/src/engine/base_layer.py:868, in Layer.from_config(cls, config)
    867 try:
--> 868     return cls(**config)
    869 except Exception as e:

File /opt/conda/lib/python3.10/site-packages/keras/src/utils/traceback_utils.py:70, in filter_traceback.<locals>.error_handler(*args, **kwargs)
     68     # To get the full stack trace, call:
     69     # `tf.debugging.disable_traceback_filtering()`
---> 70     raise e.with_traceback(filtered_tb) from None
     71 finally:

File /opt/conda/lib/python3.10/site-packages/keras/src/engine/input_layer.py:153, in InputLayer.__init__(self, input_shape, batch_size, dtype, input_tensor, sparse, name, ragged, type_spec, **kwargs)
    152 if kwargs:
--> 153     raise ValueError(
    154         f"Unrecognized keyword arguments: {list(kwargs.keys())}"
    155     )
    157 if sparse and ragged:

ValueError: Unrecognized keyword arguments: ['batch_shape']

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
Cell In[13], line 1
----> 1 model = tf.keras.models.load_model('/kaggle/input/iyntmodel/vgg19.keras')

File /opt/conda/lib/python3.10/site-packages/keras/src/saving/saving_api.py:254, in load_model(filepath, custom_objects, compile, safe_mode, **kwargs)
    249     if kwargs:
    250         raise ValueError(
    251             "The following argument(s) are not supported "
    252             f"with the native Keras format: {list(kwargs.keys())}"
    253         )
--> 254     return saving_lib.load_model(
    255         filepath,
    256         custom_objects=custom_objects,
    257         compile=compile,
    258         safe_mode=safe_mode,
    259     )
    261 # Legacy case.
    262 return legacy_sm_saving_lib.load_model(
    263     filepath, custom_objects=custom_objects, compile=compile, **kwargs
    264 )

File /opt/conda/lib/python3.10/site-packages/keras/src/saving/saving_lib.py:281, in load_model(filepath, custom_objects, compile, safe_mode)
    278             asset_store.close()
    280 except Exception as e:
--> 281     raise e
    282 else:
    283     return model

File /opt/conda/lib/python3.10/site-packages/keras/src/saving/saving_lib.py:246, in load_model(filepath, custom_objects, compile, safe_mode)
    244 # Construct the model from the configuration file in the archive.
    245 with ObjectSharingScope():
--> 246     model = deserialize_keras_object(
    247         config_dict, custom_objects, safe_mode=safe_mode
    248     )
    250 all_filenames = zf.namelist()
    251 if _VARS_FNAME + ".h5" in all_filenames:

File /opt/conda/lib/python3.10/site-packages/keras/src/saving/serialization_lib.py:728, in deserialize_keras_object(config, custom_objects, safe_mode, **kwargs)
    726 safe_mode_scope = SafeModeScope(safe_mode)
    727 with custom_obj_scope, safe_mode_scope:
--> 728     instance = cls.from_config(inner_config)
    729     build_config = config.get("build_config", None)
    730     if build_config:

File /opt/conda/lib/python3.10/site-packages/keras/src/engine/sequential.py:466, in Sequential.from_config(cls, config, custom_objects)
    464 for layer_config in layer_configs:
    465     use_legacy_format = "module" not in layer_config
--> 466     layer = layer_module.deserialize(
    467         layer_config,
    468         custom_objects=custom_objects,
    469         use_legacy_format=use_legacy_format,
    470     )
    471     model.add(layer)
    473 if (
    474     not model.inputs
    475     and build_input_shape
    476     and isinstance(build_input_shape, (tuple, list))
    477 ):

File /opt/conda/lib/python3.10/site-packages/keras/src/layers/serialization.py:276, in deserialize(config, custom_objects, use_legacy_format)
    268 if use_legacy_format:
    269     return legacy_serialization.deserialize_keras_object(
    270         config,
    271         module_objects=LOCAL.ALL_OBJECTS,
    272         custom_objects=custom_objects,
    273         printable_module_name="layer",
    274     )
--> 276 return serialization_lib.deserialize_keras_object(
    277     config,
    278     module_objects=LOCAL.ALL_OBJECTS,
    279     custom_objects=custom_objects,
    280     printable_module_name="layer",
    281 )

File /opt/conda/lib/python3.10/site-packages/keras/src/saving/serialization_lib.py:609, in deserialize_keras_object(config, custom_objects, safe_mode, **kwargs)
    602         if isinstance(module_objects[config], types.FunctionType):
    603             return deserialize_keras_object(
    604                 serialize_with_public_fn(
    605                     module_objects[config], config, fn_module_name
    606                 ),
    607                 custom_objects=custom_objects,
    608             )
--> 609         return deserialize_keras_object(
    610             serialize_with_public_class(
    611                 module_objects[config], inner_config=inner_config
    612             ),
    613             custom_objects=custom_objects,
    614         )
    616 if isinstance(config, PLAIN_TYPES):
    617     return config

File /opt/conda/lib/python3.10/site-packages/keras/src/saving/serialization_lib.py:728, in deserialize_keras_object(config, custom_objects, safe_mode, **kwargs)
    726 safe_mode_scope = SafeModeScope(safe_mode)
    727 with custom_obj_scope, safe_mode_scope:
--> 728     instance = cls.from_config(inner_config)
    729     build_config = config.get("build_config", None)
    730     if build_config:

File /opt/conda/lib/python3.10/site-packages/keras/src/engine/base_layer.py:870, in Layer.from_config(cls, config)
    868     return cls(**config)
    869 except Exception as e:
--> 870     raise TypeError(
    871         f"Error when deserializing class '{cls.__name__}' using "
    872         f"config={config}.nnException encountered: {e}"
    873     )

TypeError: Error when deserializing class 'InputLayer' using config={'batch_shape': [None, 299, 299, 3], 'dtype': 'float32', 'sparse': False, 'name': 'input_layer_1'}.

Exception encountered: Unrecognized keyword arguments: ['batch_shape']

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật