Photovoltaic power forecasting is an important topic in the fields of sustainable power system design, energy conversion management, and smart grid construction. Accurate prediction of photovoltaic power generation is the key to daily dispatch management, safe and stable operation of the power grid. Therefore, a short-term photovoltaic power generation prediction model based on adaptive Kmeans and long short-term memory (LSTM) is proposed. According to the short-term photovoltaic power generation characteristics, the initial training set of the prediction model is selected. The adaptive Kmeans is used to cluster the photovoltaic power generation of the initial training set and the prediction day. A LSTM is trained on the initial training set data of each category, and combining the trained LSTM to predict the power generation. Finally, considering three typical weather types, the proposed method is used for simulation analysis. The results show that, compared with the other three methods, the accuracy of the proposed method is improved significantly, and the error is smaller.