Vanadium dioxide (VO2) is a strong correlation material, which can undergo transition from the monoclinic phase to the rutile phase near 340 K at ambient pressure. This phase transition can be controlled by extreme changes of optical, electrical and thermodynamic properties, and thus VO2 film possesses various potential device applications. Physically, lattice dynamics play a critical role in the investigation of the phase mechanism and properties of VO2. Given that widely adopted methods such as the density-functional perturbation theory and the quasiharmonic approximation (QHA) are typically only suitable to calculate the VO2 monoclinic phase, in this work we employ the temperature-dependent effective potential (TDEP) method to calculate the phonon properties of the two phases of VO2 by considering the anharmonicity of the lattice vibrations. Assisted by the experimental data, a resistance–temperature phase diagram has been constructed. The results show that the monoclinic phase is unstable because of the existence of the imaginary frequency. Compared with the thermal expansion, calculated by the QHA and TDEP methods, it is demonstrated that the TDEP method is reliable for the stable rutile phase, in which the imaginary frequency disappears. Simultaneously, it is shown that the calculated Gibbs free energy of VO2 agrees with the experimental results. Our work provides robust evidence tthat the anharmonicity in the lattice dynamics of VO2 cannot be ignored.