code: def setUpClass(cls):
      with tf.Graph().as_default():
          # - Classify ImageNet classes with VGG16, see `tutorial_models_vgg16.py <https://github.com/tensorlayer/tensorlayer/blob/master/example/tutorial_models_vgg16.py>__`
          x = tf.placeholder(tf.float32, [None, 224, 224, 3])
          # get the whole model
          vgg1 = tl.models.VGG16(x)
          # restore pre-trained VGG parameters
          # sess = tf.InteractiveSession()
          # vgg.restore_params(sess)
          # use for inferencing
          # probs = tf.nn.softmax(vgg1.outputs)
  
          cls.vgg1_layers = vgg1.all_layers
          cls.vgg1_params = vgg1.all_params
  
      with tf.Graph().as_default():
          # - Extract features with VGG16 and Train a classifier with 100 classes
          x = tf.placeholder(tf.float32, [None, 224, 224, 3])
          # get VGG without the last layer
          vgg2 = tl.models.VGG16(x, end_with="fc2_relu")
  
          cls.vgg2_layers = vgg2.all_layers
          cls.vgg2_params = vgg2.all_params
  
          print("TYPE:", type(vgg2))
  
          # add one more layer
          _ = tl.layers.DenseLayer(vgg2, n_units=100, name="out")
          # initialize all parameters
          # sess = tf.InteractiveSession()
          # tl.layers.initialize_global_variables(sess)
          # restore pre-trained VGG parameters
          # vgg.restore_params(sess)
          # train your own classifier (only update the last layer)
  
          cls.vgg2_train_params = tl.layers.get_variables_with_name(
              "out"
          )
  
      with tf.Graph().as_default() as graph:
          # - Reuse model
          x = tf.placeholder(tf.float32, [None, 224, 224, 3])
          # get VGG without the last layer
          vgg3 = tl.models.VGG16(x, end_with="fc2_relu")
          # reuse the parameters of vgg1 with different input
          # restore pre-trained VGG parameters (as they share parameters, we don’t need to restore vgg2)
          # sess = tf.InteractiveSession()
          # vgg1.restore_params(sess)
  
          cls.vgg3_layers = vgg3.all_layers
          cls.vgg3_params = vgg3.all_params
          cls.vgg3_graph = graph
  
file_path: TensorLayer/tests/pending/test_models.py
imports: import os
  import unittest
  import tensorflow
  import tensorlayer
  from tests.utils import CustomTestCase
label_desc: Use image node_id 1 for calling the VGG_Model_Test obj's underlying member method code with example usage: obj.setUpClass(cls) without return types