Global Positioning System (GPS)/Inertial Measurement Unit (IMU) fusion improves positioning accuracy. Existing fusion algorithms are mainly based on the Bayesian filtering framework. Still, the algorithm performs poorly in applying historical states, defining the state transition model, and correcting IMU computation errors during GPS interruption. This paper proposes GPS/IMU fusion localization based on Attention-based Long Short Term Memory (Attention-LSTM) Networks and sliding windows to solve these problems. we use Attention-LSTM networks to fuse GPS and IMU information to build a nonlinear model that fits the current noisy environment by training the model. In addition, the sliding window size can determine the number of historical state information utilized. We experimentally demonstrate that the method's positioning accuracy is improved under interrupted and uninterrupted GPS conditions.