Glioma is the most common primary tumor in the skull, but it has no obvious boundary with normal brain tissue and is difficult to completely remove. Currently, manual segmentation of the lesion regions has been widely used in the clinical practice of magnetic resonance (MR) images of gliomas, but the implementation process has disadvantages such as time‐consuming and poor repeatability. It is because of the shortcomings of traditional segmentation methods that we must seek other efficient technical means, which promote the development of automatic image segmentation technology. In this study, we propose a glioma automatic segmentation method called NLCA‐VNet. The framework is based on VNet, adding nonlocal and convolutional block attention modules, which can maintain more information, and can carry out attention in the channel and spatial dimensions, so that improve the segmentation effect. We employ the extended glioma MR image data set by the Brain Tumor Segmentation Challenge database (BraTS 2020, 2019, 2018), and finally obtained the effect image after tumor segmentation and achieved average Dice scores of 0.6702, 0.876, 0.7687, sensitivity of 0.7494, 0.9209, 0.7702, specificity of 0.0.9994, 0.9985, 0.9995, and Hausdorff95 of 50.8613, 9.3667, 12.4573 for enhancing tumor core, whole tumor, and tumor core in BraTS 2020, respectively. The results fully show that our method can fully adapt to the segmentation of glioma. To a certain extent, it improves the efficiency and accuracy of the doctor's diagnosis, which is of great significance to the scientific research and clinical aspects of glioma.