AttributeError: 'DirectoryIterator' object has no attribute '_assert_compile_was_called' google colab

model_fit = model.fit(Train_dataset,
    validation_data=Val_dataset, 
  steps_per_epoch=5, epochs=10)

I tried this code snippet and getting an error saying "AttributeError: 'DirectoryIterator' object has no attribute '_assert_compile_was_called'". I tried downgrading the tensorflow version, but it's not working.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum