To improve the predictive accuracy of sunspot numbers, a hybrid model was built to forecast future sunspot numbers. In this paper, we present a prediction model based on complete ensemble empirical mode decomposition with adaptive noise (CEEMDAN), gated recurrent unit (GRU), and error compensation for predicting sunspot numbers. CEEMAND is applied to decompose the original sunspot number data into several components, which are then used to train and test the GRU for the optimal parameters of the corresponding sub-models. Error compensation is utilized to solve the delay phenomenon between the original sunspot number and the predictive result. We compare our method with the informer, extreme gradient boosting combined with deep learning (XGboost-DL), and empirical mode decomposition combined long short-term memory neutral network and attention mechanism (EMD-LSTM-AM) methods, and evaluation metrics, such as RMSE and MAE, are used to measure their performance. Our method decreases more than 2.2813 and 3.5827 relative to RMSE and MAE, respectively. Thus, the experiment can demonstrate that our method has an obvious advantage compared to others.