Tf.function-decorated function tried to create variables on non-first call

I completed my code error free and even obtained the total score but when i tried to run the model in my own images, it showed this error. Could you help someway?

And my code is

There is nothing wrong with your code: that’s just the way the code is set up in that notebook. The execution is stateful: you can’t run the cell that creates that function twice. If you want to rerun it, you have to run everything from scratch again. Try “Kernel → Restart and Clear Output” and then “Cell → Run All”.

Thanks for your help