Phase unwrapping (PU) has always been a critical and challenging step in interferometric synthetic aperture radar (InSAR) data processing. Inspired by existing research, i.e., the PGNet, we propose a novel quality-guided 2-D InSAR PU method via deep learning, and regard PU as a two-stage process. In the first stage, the ambiguity gradient is estimated using the proposed global attention U-Net (GAUNet) architecture, which combines the classic U-Net structure and global attention mechanism. Then in the second stage, the classical PU framework (e.g., the L1-or L2-norm) is applied as a post-processing operation to retrieve the absolute phase. Since class imbalance is a key factor affecting the estimation of ambiguity gradient, different strategies based on four commonly used quality maps are adopted to deal with the problem. The quality map is not only input as additional information for the guidance of the training process, but also participates in the construction of loss function. As a result, GAUNet can pay more attention to the non-zero ambiguity gradients. By using the number of residues as the evaluation metric, we can choose the optimum strategy for the restoration of the absolute phase. In addition to the simulated interferograms, the proposed method is tested both on a real topographic interferogram exhibiting rugged topography and phase aliasing and a differential interferogram measuring the deformation from MW 6.9 Hawaii earthquake, all yield state-of-art performance when comparing with the widely used traditional 2-D PU methods.