Gas injection and water injection are common and effective methods to improve oil recovery. To ensure its production effect, it is necessary to simulate the oilfield production process. However, traditional composition simulation runs a large number of calculations and takes a long time. Through the analysis of relevant data, we found that production is affected by many factors and has a strong sequential character. Therefore, this paper proposes a deep learning model for reservoir production prediction based on stacked long short-term memory network (LSTM). It is applied to other well patterns with a short production time and a few samples in the same oilfield block by transfer learning. The model achieves an effective combination with the actual reservoir production process. At the same time, it uses the knowledge learned from the well pattern with sufficient historical data to assist in the establishment of the model of the well pattern with limited data. This can obtain accurate prediction results and save the model training time, thus getting more effective application effects than composition simulation. This paper verifies the effectiveness of the proposed method through the data and multiple different injection combinations of the Tarim oilfield.