Most of the structural and evolutionary properties of galaxies rely on the numbers of stars with different masses. The initial mass function (IMF), referred to as the distribution of the initial stellar mass formed in a stellar population, plays crucial roles from the formation of stars to the evolution of galaxies. While many works found no variation of IMF in the Milky Way, studies of the external galaxies claimed that IMF is variable. These works are mostly based on observed samples with a strong dependence on some models. Therefore, direct and less model-dependent evidence of the variation of IMF is highly requested to pin down this essential issue. In our work, we find that the IMF varies with stellar ages as well as metallicity in the solar neighbourhood. By directly counting stars with various masses, we find that older stellar populations contain fewer low-mass stars than the young ones, i.e. they show bottom-light IMF. Meanwhile, the shape of the metal-rich IMF is correlated with stellar metallicity. These results support the theory that IMF is related to both metallicity and star formation rate, which is a temporal quantity in the Galaxy. The non-universality of the IMF will fundamentally change our knowledge of the evolution of the extra-galaxies as well as the Milky Way.