My friend wrote the above code. But a friend can no longer help. So I asked for it here.
The problem with the code is that the loss value increases too much each time the epoch is increased.
The above code is a file called main.py in the folder given by a friend in a cmd window. The data load or CNN related code is in another file. If it is okay with you, I would like to send you the whole folder by mail.