title: ValueError: Unexpectedly found an instance of type `<class 'keras.layers.core.lambda_layer.Lambda'>`. Expected a symbolic tensor instance
body: <p>I am trying to train a CIFAR10 dataset using transfer learning and a research paper used a resize technique but the functions change names. I am getting this error how can i fix this.</p>
  <pre><code>inputs = keras.Input(shape=(32, 32, 3))
  upscale = keras.layers.Lambda(lambda x: tf.image.resize(x, 160, 160, method= (tf.image.ResizeMethod.BILINEAR))(inputs))
  densenet_model = tf.keras.applications.densenet.DenseNet121(include_top=False, pooling = max, input_tensor=upscale, input_shape=(160, 160, 3), weights='imagenet')
  # when you change the input shape, keras will automatically change the shapes of the other layers accordingly . to meet the new input shape
  densenet_model.summary()
  x = densenet_model.output
  x = keras.layers.Flatten()(x)
  x = keras.layers.BatchNormalization()(x)
  x = keras.layers.Dense(256, activation='relu')(x)
  x = keras.layers.Dropout(0.3)(x)
  x = keras.layers.BatchNormalization()(x)
  x = keras.layers.Dense(128, activation='relu')(x)
  x = keras.layers.Dropout(0.3)(x)
  x = keras.layers.BatchNormalization()(x)
  x = keras.layers.Dense(64, activation='relu')(x)
  x = keras.layers.Dropout(0.3)(x)
  x = keras.layers.Dense(10, activation='softmax')(x)
  #output = keras.layers.Dense(units=10, activation='softmax')(x) # output layer with softmax activation
  model = keras.Model(inputs=densenet_model.input, outputs=x)
  
  for layer in densenet_model.layers:
      layer.trainable=False
  </code></pre>
  <p>ValueError: Unexpectedly found an instance of type <code>&lt;class 'keras.layers.core.lambda_layer.Lambda'&gt;</code>. Expected a symbolic tensor instance.</p>