We conduct a tomographic inversion for the 3D P‐wave velocity structure in the lower crust and uppermost mantle of the Sichuan–Yunnan region in the southeastern margin of the Tibetan Plateau. A total of 43,450 reliable arrival times of P waves are picked from over 300,000 regional seismic records using an automatic algorithm based on deep learning. A two‐stage iterative inversion process in which events are relocated, leading to a significant reduction in travel‐time residuals, is adopted. A statistical resolution matrix analysis suggests that our model has an optimal spatial resolution length of ∼0.4° in the lower crust and ∼0.2° in the uppermost mantle. Our 3D model shows that both the lower crust and uppermost mantle in the region are characterized by strong lateral heterogeneities. The unusually low velocities in the lower crust may indicate the existence of lower crustal flow, whereas the high‐velocity anomalies in the uppermost mantle in and around the Sichuan–Yunnan Rhombic block (SYRB) may be an important factor in preventing the ductile materials in the lower crust from moving eastward. Our model also indicates a coupling between the surface deformation and the material flow in the lower crust. Finally, the lower crustal flow may influence the materials in the shallow part of the uppermost mantle beneath the SYRB, and the crust–mantle transition zone beneath the Songpan–Ganzi block may be influenced by weak materials from both the uppermost mantle and the lower crust.