i ran debg and it shows me this :

Ah, the post mortem ended up in the finally block.
You can use %%debug and set a breakpoint… but that f.close() tells us that opened_new_file is True.
So isinstance(filepath, h5py.File) is returning False. That doesn’t seem to be an H5py file. and that code creates a new empty h5py file?:

  

      github.com
  

  
    tensorflow/tensorflow/blob/master/tensorflow/python/keras/saving/hdf5_format.py#L165 1



      
      
          Raises:
              ImportError: if h5py is not available.
              ValueError: In case of an invalid savefile.
          """
          if h5py is None:
            raise ImportError('`load_model` requires h5py.')
          
          
if not custom_objects:
            custom_objects = {}
          
          
opened_new_file = not isinstance(filepath, h5py.File)
          if opened_new_file:
            f = h5py.File(filepath, mode='r')
          else:
            f = filepath
          
          
model = None
          try:
            # instantiate model
            model_config = f.attrs.get('model_config')
            if model_config is None: