As shipping continues to play an increasingly important role in world trade, there are consequently a large number of ships at sea at any given time, posing a risk to maritime traffic safety. Therefore, the tracking and monitoring of ships at sea has gradually attracted the attention of scholars. Ship trajectory prediction comprises an important aspect of ship tracking and monitoring. Trajectory prediction describes the forecasting of a ship’s future trajectory over a period of time through use of historical trajectory information of the ship, so as to predict the sailing dynamics of the ship in advance. Accurate trajectory prediction can help maritime regulatory authorities improve supervision efficiency and reduce collisions between ships. Temporal Convolutional Network (TCN) offers good time memory ability and has shown better performance in time series prediction in recent years. Ship trajectory sequence belongs to the category of time series. Thus, in this paper, we introduce TCN into the field of ship trajectory prediction and improve on it, and propose Tiered-TCN (TTCN). The attention mechanism is a way to help neural networks learn data features by highlighting features that have a greater impact on predicted values. Gate Recurrent Unit (GRU) is an important variant of Recurrent Neural Networks (RNN), which bears a strong nonlinear fitting ability. In this paper, TTCN, attention mechanism and GRU network are integrated to construct a hybrid model for trajectory prediction, which is referred to as TTCN-Attention-GRU (TTAG). By optimizing the advantages of each module, the prediction effect is achieved with high precision. The experimental results show that the TTAG model is superior to all the baseline models presented in this paper.