With the rapid economic growth and the continuous increase in population, cars have become a necessity for most people to travel. The increase in the number of cars is accompanied by serious traffic congestion. In order to alleviate traffic congestion, many places have introduced policies such as vehicle restriction, and intelligent transportation systems have gradually been put into use. Due to the chaotic complexity of the traffic road network and the short-term mobility of the population, traffic flow prediction is affected by many complex factors, and an effective traffic flow forecasting system is very challenging. This paper proposes a model to predict the traffic flow of Wenyi Road in Hangzhou. Wenyi Road consists of four crossroads. The four intersections have the same changing trend in traffic flow at the same time, which indicates that the roads influence each other spatially, and the traffic flow has spatial and temporal correlation. Based on this feature of traffic flow, we propose the IMgru model to better extract the traffic flow temporal characteristics. In addition, the IMgruGcn model is proposed, which combines the graph convolutional network (GCN) module and the IMgru module, to extract the spatiotemporal features of traffic flow simultaneously. Finally, according to the morning and evening peak characteristics of Hangzhou, the Wenyi Road dataset is divided into peak period and off-peak period for prediction. Comparing the IMgruGcn model with five baseline models and a state-of-the-art method, the IMgruGcn model achieves better results. Best results were also achieved on a public dataset, demonstrating the generalization ability of the IMgruGcn model.