Add run_eagerly=True to model.compile() to disable graph execution. This will force the model to execute eagerly
run_eagerly=True
model.compile()
in the code:
model.compile(loss=..., optimizer=..., metrics=..., run_eagerly=True)