I tried downgrading tensorflow to 2.4.0 and the error still occurred.
The strange thing is that when I run the code, the trained epoch has not consistency.
For example, at first run, train stopped at 2 epoch, and next run, train stopped at 13 epoch.
I thought the problem is my gpu(GTX 1660 Ti) memory, but running the code has taken about 55% of gpu memory.