Coronavirus disease 2019 (COVID-19) broke out in Wuhan at the end of 2019 and quickly spread to other cities in China. Here, we provided a model to predict the number of COVID-19 infections in Wuhan based on deep learning methods. In addition to epidemic data, environmental and social factors including population migration, temperature and internet search data were considered. We compared the performance of long short-term memory (LSTM) model and convolutional neural network (CNN) model. The performance of the CNN model was 12.5% higher than that of the LSTM model. Moreover, population migration and internet search data can respectively improve the prediction performance of the model. We desire that the proposed model can predict the number of cases in the early stages of infectious disease outbreaks, and be extended to the prediction of other infectious diseases.