My machine is MacBook Pro 2020 13-inch, TensorFlow version is 2.4.
When I use model.predict() and model.evaluate(), no matter which function is used first, the output result of the other function will be seriously different from expected.
I mean that if I use model.predict(test_x), and then I use model.evaluate(test_x,test_y), the result about accuracy is very lower than my expectation. If I don't use model.predict(test_x) before using model.evaluate(test_x,test_y), I will get a perfect accuracy.
Code show as below
My machine is MacBook Pro 2020 13-inch, TensorFlow version is 2.4. When I use model.predict() and model.evaluate(), no matter which function is used first, the output result of the other function will be seriously different from expected. I mean that if I use model.predict(test_x), and then I use model.evaluate(test_x,test_y), the result about accuracy is very lower than my expectation. If I don't use model.predict(test_x) before using model.evaluate(test_x,test_y), I will get a perfect accuracy. Code show as below