The Shack–Hartmann wavefront sensor (SHWFS) has been widely used for measuring aberrations in adaptive optics systems. However, its traditional wavefront reconstruction method usually has limited precision under field conditions because the weight-of-center calculation is affected by many factors, such as low signal-to-noise-ratio objects, strong turbulence, and so on. In this paper, we present a ResNet50+ network that reconstructs the wavefront with high precision from the spot pattern of the SHWFS. In this method, a nonlinear relationship is built between the spot pattern and the corresponding Zernike coefficients without using a traditional weight-of-center calculation. The results indicate that the root-mean-square (RMS) value of the residual wavefront is 0.0128 μm, which is 0.79% of the original wavefront RMS. Additionally, we can reconstruct the wavefront under atmospheric conditions, if the ratio between the telescope aperture’s diameter D and the coherent length r
0 is 20 or if a natural guide star of the ninth magnitude is available, with an RMS reconstruction error of less than 0.1 μm. The method presented is effective in the measurement of wavefronts disturbed by atmospheric turbulence for the observation of weak astronomical objects.