docstr: Test loading h5 weights by name.
docstr_tok: ["Test","loading","h5","weights","by","name","."]
code: def test_load_h5_weights_by_name(self):
      """Test loading h5 weights by name."""
      model = self.get_model()
      filepath = os.path.join(
          self.get_temp_dir(), "test_weights.weights.h5"
      )
      model.save_weights(filepath)
      with self.assertRaisesRegex(
          ValueError, "Invalid keyword arguments"
      ):
          model.load_weights(filepath, by_name=True)
  
imports: import os
  import unittest.mock
  import numpy
  from absl import logging
  from keras import layers
  from keras.models import Sequential
  from keras.saving import saving_api
  from keras.testing import test_case
label_desc: Use image node_id 3 for calling the LoadWeightsTests obj's underlying member method code with example usage: obj.test_load_h5_weights_by_name() without return types