It can happen to females, too, though I hear it's rare. My first snake, an Opal girl, did this every spring starting as a yearling for three years while she was growing up. Normally she was a voracious eater (coiled all around the thawed mice like she was a black rat who just got a kill XD), but each spring she would only eat sporadically over the course of a month or two, usually only taking two meals during that time.
I would go through the typical methods of trying to get them to eat, as in any other case. Try heating the mice, leaving them in a dark spot with it, cutting the mice so they can smell the blood, etc. I know the only thing Kel would eat was live mice during this time, but I recommend only using that as a last resort, and then reintroduce them to frozen once they've gotten a meal in.
Best of luck.