To be unpopular is in the criteria for being a nerd.
I think it is actually a compliment (not complement, although that typo would have been a great pun).
Some people do not like it if someone is pedantic (e.g. my father) and some people simply do not like people being smarter than them (e.g. Chris Langan's father).
But it is not a fact that it is not liked.
High school is mainly a popularity contest to some people, in some schools.
After that it ought to be smooth sailing.
Although I am now doubting myself, because people rarely change.
And war never changes (Fallout 3 reference).