The reason this occurs is not enough to cause gpu memory, usually we set up the program in accordance with the growth in demand caused by
Here, we set allow_growth = False can control the growth of video memory used to control the use of memory, and the program will not run half of the error.
This case is built on our memory is relatively small strategies used, if the memory is large enough that we do not worry about this problem.