C2W3_Assignment | value error |

I’m struggling with a ValueError, but I have no idea what is a problem:
Found unexpected instance while processing input tensors for keras functional model. Expecting KerasTensor which is from tf.keras.Input() or output from keras layer call(). Got: <keras.engine.functional.Functional object at 0x7f613affff90>

My source code is attached:

I’m looking forward to hearing help from you guys.


Here are some hints:

  1. Inside train_val_generators, don’t define train and validation directories. Use the function parameters instead.
  2. In loss="name", the name has typos
  3. Model is created incorrectly. You’ll find this text from the markdown helpful

Note that you can get the input from any existing model by using its input attribute and by using the Funcional API you can use the last layer directly as output when creating the final model.

Is the query resolved sir?