In the actual work of rolling bearings, the probability distribution of output data will change due to changes in load and speed, which will lead to a decrease in the accuracy of the diagnostic model, or even failure. To solve this problem, this paper proposes a fault diagnosis model based on the combination of maximum mean discrepancy (MMD) and Generative adversarial network (GAN), which is called MMD-GAN. The proposed method extracts data features through a convolutional neural network, and then MMD and GAN are combined to reduce the distribution difference between the source and target domain dataset, result in more accurate fault diagnosis results. Finally, experiments were conducted through the CRWU rolling bearing data set, and the effectiveness of the proposed scheme has been verified.