The deformation evolution of giant dipole resonance (GDR), in the chains of Sm and Nd isotopes, are investigated in the framework of an extended quantum molecular dynamics (EQMD) model. The mass number dependence of resonance peak position (Em) in the major and minor axis directions of deformed nuclei as well as the difference ∆Em between them are described in detail. The correlation between the splitting (∆Em/ Ēm) of the GDR spectra and the deformation(β2) is further studied. The results confirm that ∆Em/ Ēm is proportional to β2. By comparing the calculation with the experimental data on photon absorption cross section σγ, it shows that the EQMD model can quite well reproduce the shape of GDR spectra from spherical to prolate shape. The GDR shapes in 134 Sm, 136 Sm, 138 Sm, 130 Nd, 132 Nd and 134 Nd are also predicted. In addition, the symmetry energy coefficient (Esym) dependence of GDR spectra of 150 Nd is also discussed. It is found that the calculated GDR spectrum in the EQMD model is perfectly consistent with the experimental results when Esym equals to 32 MeV.