Based on the hologram inpainting via a two-stage Generative Adversarial Network (GAN), we present a precise phase aberration compensation method in digital holographic microscopy (DHM). In the proposed methodology, the interference fringes of the sample area in the hologram are firstly removed by the background segmentation via edge detection and morphological image processing. The vacancy area is then inpainted with the fringes generated by a deep learning algorithm. The image inpainting finally results in a sample-free reference hologram containing the total aberration of the system. The phase aberrations could be deleted by subtracting the unwrapped phase of the sample-free hologram from our inpainting network results, in no need of any complex spectrum centering procedure, prior knowledge of the system, or manual intervention. With a full and proper training of the two-stage GAN, our approach can robustly realize a distinct phase mapping, which overcomes the drawbacks of multiple iterations, noise interference or limited field of view in the recent methods using self-extension, Zernike polynomials fitting (ZPF) or geometrical transformations. The validity of the proposed procedure is confirmed by measuring the surface of preprocessed silicon wafer with a Michelson interferometer digital holographic inspection platform. The results of our experiment indicate the viability and accuracy of the presented method. Additionally, this work can pave the way for the evaluation of new applications of GAN in DHM.