As the core component of the near-earth space environment, the accurate observation of the TEC (total electron content) is of great significance for understanding its spatial and temporal changes. Therefore, the modeling and prediction of the ionosphere TEC is particularly important. In view of the periodic variation nature of ionosphere TEC, this study used long and short-term memory network (LSTM) and Transformer neural network to predict ionosphere TEC in 2014 and 2017. The prediction results were comprehensively evaluated by RMSE (root mean square error) and MAE (mean absolute error), and the difference of RMSE in different latitudes was analyzed in depth. The results showed that RMSE was generally higher than that in higher latitudes. In addition, by comparing the performance of LSTM and Transformer neural networks in single-step and multi-step prediction, LSTM network is more advantageous in the ionosphere TEC data prediction, especially for single-step prediction.