There are inevitable multiphase flow problems in the process of subsea oil-gas acquisition and transportation, of which the two-phase flow involving gas and liquid is given much attention. The performance of pipelines and equipment in subsea systems is greatly affected by various flow patterns. As a result, correctly and efficiently identifying the flow pattern in a pipeline is critical for the oil and gas industry. In this study, two attention modules, the convolutional block attention module (CBAM) and efficient channel attention (ECA), are introduced into a convolutional neural network (ResNet50) to develop a gas–liquid two-phase flow pattern identification model, which is named CBAM-ECA-ResNet50. To verify the accuracy and efficiency of the proposed model, a collection of gas–liquid two-phase flow pattern images in a vertical pipeline is selected as the dataset, and data augmentation is employed on the training set data to enhance the generalization capability and comprehensive performance of the model. Then, comparison models similar to the proposed model are obtained by adjusting the order and number of the two attention modules in the two positions and by inserting other different attention modules. Afterward, ResNet50 and all proposed models are applied to classify and identify gas–liquid two-phase flow pattern images. As a result, the identification accuracy of the proposed CBAM-ECA-ResNet50 is observed to be the highest (99.62%). In addition, the robustness and complexity of the proposed CBAM-ECA-ResNet50 are satisfactory.