          msg = ""
          if not os.path.exists(weights_file):
              msg = "Load weights selected, but the path '%s' does not exist."
          elif not os.path.splitext(weights_file)[-1].lower() == ".h5":
              msg = "Load weights selected, but the path '%s' is not a valid Keras model (.h5) file."
  
          if msg:
              msg += " Please check and try again."
              logger.error(msg)
  
 
</s> remove             msg = "Load weights selected, but the path '%s' does not exist."
 </s> add             msg = f"Load weights selected, but the path '{weights_file}' does not exist." </s> remove             logger.error(msg)
 </s> add             raise FaceswapError(msg)
            msg = (f"Load weights selected, but the path '{weights_file}' is not a valid Keras "
                   f"model (.h5) file.")
          msg = ""
          if not os.path.exists(weights_file):
              msg = "Load weights selected, but the path '%s' does not exist."
          elif not os.path.splitext(weights_file)[-1].lower() == ".h5":
            msg = (f"Load weights selected, but the path '{weights_file}' is not a valid Keras "
                   f"model (.h5) file.")
  
          if msg:
              msg += " Please check and try again."
              logger.error(msg)
  
keep keep keep keep replace keep keep keep keep keep
 Bugfix -Weights freezing/loading for dfl-sae 
plugins/train/model/_base.py