Model.evaluate() takes up a lot of memory

I was stuck into the “insufficient memory” difficulty. When I checked the memory usage with the help of ‘@profile’ I found that the ‘evaluate()’ method caused a significant increment. But from my perspective, it’s just a computation progress and its return value is a 2-elements list so that it should have no effect on the memory. I’ll appreciate you if you tell me how to solve this problem, thanks!

Hi @GentleWine, Could you please let us know how many samples you are using for training and evaluation. Also by default model.evaluate( ) takes a default batch size of 32 if the batch size is unspecified, could you please try with the small batch size and see if you are facing the same error or not. Thank You.