code: def test_save(self):
      MLP = Model.load(
          "MLP.hdf5",
      )
  
      MLP.eval()
  
      n_epoch = 3
      batch_size = 500
      train_weights = MLP.trainable_weights
      optimizer = tf.optimizers.Adam(lr=0.0001)
      (
          X_train,
          y_train,
          X_val,
          y_val,
          X_test,
          y_test,
      ) = tl.files.load_mnist_dataset(shape=(-1, 784))
      val_loss, val_acc, n_iter = 0, 0, 0
      for X_batch, y_batch in tl.iterate.minibatches(
          X_val, y_val, batch_size, shuffle=False
      ):
          _logits = MLP(X_batch)  # is_train=False, disable dropout
          val_loss += tl.cost.cross_entropy(
              _logits, y_batch, name="eval_loss"
          )
          val_acc += np.mean(np.equal(np.argmax(_logits, 1), y_batch))
          n_iter += 1
      print("   val loss: {}".format(val_loss / n_iter))
      print("   val acc:  {}".format(val_acc / n_iter))
      assert val_acc > 0.7
  
      for epoch in range(n_epoch):  ## iterate the dataset n_epoch times
          print("epoch = ", epoch)
  
          for X_batch, y_batch in tl.iterate.minibatches(
              X_train, y_train, batch_size, shuffle=True
          ):
              MLP.train()  # enable dropout
  
              with tf.GradientTape() as tape:
                  ## compute outputs
                  _logits = MLP(
                      X_batch
                  )  # alternatively, you can use MLP(x, is_train=True) and remove MLP.train()
                  ## compute loss and update model
                  _loss = tl.cost.cross_entropy(
                      _logits, y_batch, name="train_loss"
                  )
  
              grad = tape.gradient(_loss, train_weights)
              optimizer.apply_gradients(zip(grad, train_weights))
  
      MLP.save("MLP.hdf5")
  
imports: import os
  import unittest
  import numpy
  import tensorflow
  import tensorlayer
  from tensorlayer.layers import *
  from tensorlayer.models import *
  from tests.utils import CustomTestCase
label_desc: Use image node_id 2 for calling the Model_Load_with_weights_and_train obj's underlying member method code with example usage: obj.test_save() without return types