In order to effectively control the co-channel interference in Device-to-Device (D2D) communication system while reducing the implementation complexity of the system, a Graph Convolutional Network (GCN)-based distributed power allocation algorithm was proposed to maximize the weighted sum rate of all D2D links. Firstly, the system topology was built into a graph model, and the characteristics of nodes and edges as well as the message-passing manners were defined. Then, the unsupervised learning model was used to train the model parameters in the GCN. After the offline training, each D2D link was able to obtain the optimal power allocation strategy in a distributed manner based on local channel state information and the interaction with neighboring nodes. Experimental results show that compared with the optimization theory-based algorithm, the proposed algorithm cuts down the running time by 97.41% while suffering only 3.409% weighted sum rate loss; and compared with the deep reinforcement learning theory-based algorithm, the proposed algorithm has better generalization ability and is stable under different setting of parameters.