The main bearing is the core component of gas-fired generator, and its reliability directly affects the stability of the whole system. Therefore, it is of great significance to study the fault diagnosis of the main bearing of gas-fired generator. In the bearing fault diagnosis based on vibration signal, how to extract the signature features of fault effectively is the key to achieving accurate fault diagnosis. Based on extracting the signature features of faults, how to classify the fault features efficiently is another key to achieving accurate fault diagnosis. Based on this, we propose a bearing fault diagnosis method based on Mel frequency cepstrum coefficient (MFCC) and deformable space-frequency attention network (DSFAN). In view of the inconsistent feature distribution of different types of faults, the MFCC algorithm is introduced to preprocess the original fault signals and extract their signature features. Then, the network model DSFAN is constructed based on the space-frequency feature attention mechanism (SFFAM). DSFAN can extract the global constraint features and distributed constraint features of fault signals and realize bearing fault diagnosis. To make full use of classification information, the data processed by MFCC is constructed into a three-dimensional data cube as the input of DSFAN. Finally, the validity of the proposed method MFCC-DSFAN is verified on CWRU, XJTU, and gas-fired generator data sets. The experimental results show the excellent performance of MFCC-DSFAN for fault diagnosis and prove the effectiveness of the attention module in feature extraction.