In recent times, machine learning has shown its efficiency in the field of fault diagnosis. Nevertheless, in many real-world applications, the basic data are often collected under the condition of machine working condition change, thereby leading to large distribution divergences. Thus, we propose the novel general normalized maximum mean discrepancy (GNMMD) feature-learning method to overcome the limitation of unstable conditions. The proposed algorithm can efficiently handle high-dimensional inputs by enforcing three constraints on the matrix of the learned features, and can optimize the objective function-based generalized norm features and MMD. First, this study analyzes the mapping characteristics of the generalized norm. Second, the feature selection approach based on GNMMD is further studied. Third, the current research also discusses the effects of different choices of norm on the diagnosis performance. Lastly, the data sets of the rolling bearing and planetary gear under unstable conditions are used to verify that the proposed method can achieve superior results.