In wireless sensor networks (WSNs), wireless sensor nodes can be equipped with deep neural network accelerators to deal with the computation challenges in distributed training. However, the communication overhead of distributed training and the limited battery capacity of sensor nodes still impedes the broad deployment of distributed training applications. This article investigates the distributed training in WSNs by formulating an aggregation-aware routing problem into a non-linear integer programming problem. The objective of the formulated problem is to reduce the training time using data aggregation-aware routing under the constraints of memory size and energy cost. Meanwhile, the NP-Hardness of the formulated problem is proved in this article. Then, an intra-cluster aggregation-aware routing algorithm is proposed. The proposed algorithm accelerates the transmission of the data packet by integrating the K-Means clustering and shortest path routing to choose the aggregators and the route paths. Extensive experiments demonstrate that the proposed algorithm outperforms two classical clustering routing algorithms UC-LEACH and K-Means by 29% and 37% in terms of average training time, and reducing the energy consumption by 21% and 15%, respectively.