Model.predict() throws error when model definition is subclassed

I defined my model using model subclassing which takes in training data in the form [pair1,pair2,label] for training and [pair1,pair2] for prediction. Training works fine however I get an error when I call model.predict() on the prediction data. All data pipelines are created using

Here is the error message I am getting ;

        return step_function(self, iterator)
    /tmp/ipykernel_33/ call  *
        x1,x2 = inputs
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/ __iter__
    /opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/ _disallow_iteration
        self._disallow_when_autograph_enabled("iterating over tf.Tensor`")
   ` /opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/ _disallow_when_autograph_enabled
        " indicate you are trying to use an unsupported feature.".format(task))`

    OperatorNotAllowedInGraphError: iterating over `tf.Tensor` is not allowed: AutoGraph did convert this function. This might indicate you are trying to use an unsupported feature.

Below is my model definition;

    def __init__(self,num_classes):
        self.num_classes = num_classes
        self.base_model = tf.keras.applications.efficientnet.EfficientNetB0(
            weights='imagenet', input_shape=[*IMG_SHAPE,3], include_top=False
        self.base_model.trainable = False
        = tf.keras.layers.GlobalAveragePooling2D()
        self.concat = tf.keras.layers.Concatenate(axis=1)
        self.classifier = tf.keras.layers.Dense(num_classes,activation="sigmoid",name="output")
    def call(self,inputs):
        x1,x2 = inputs
        x1 = self.base_model(x1)
        x2 = self.base_model(x2)
        x1 =
        x2 =
        x = self.concat([x1,x2])
        return self.classifier(x) 
    def build_model(self,inputs):
        x1,x2 = inputs
        input1 = tf.keras.Input(shape=x1)
        input2 = tf.keras.Input(shape=x2)
        return tf.keras.Model(inputs=[input1,input2],[input1,input2]))

I have been able to solve this issue now and I am able to train and predict with no issues. it turns out my way of creating the data using the was wrong. After making that correction everything works as it should be.