If you happen to forget a person’s name, don’t panic.  It happens to everyone.  Simply ask the person their name and make light of your forgetfulness.  You might say, “It’s been one of those days.
Please tell me your name again.”   If you can’t remember the person’s name, but recognize them from a particular event, use that to your advantage.  For example, “I enjoyed talking with you during the question and answer session last night, but I’m having trouble placing your name.”  The person will be flattered to have been remembered, even if you didn’t recall their name.