The contact force network, usually organised inhomogeneously by the inter-particle forces on the bases of the contact network topologies, is essential to the rigidity and stability in amorphous solids. How to capture such a 'backbone' is crucial to the understanding of various anomalous properties or behaviors in those materials, which remains a central challenge presently in physics, engineering, or material science. Here we use a novel graph neural network to predict the contact force network in two-dimensional granular materials under uniaxial compression. With the edge classification model in the framework of the deep graph library, we show that the inter-particle contact forces can be accurately estimated purely from the knowledge of the static microstructures, which can be acquired from a discrete element method or directly visualized from experimental methods. By testing the granular packings with different structural disorders and pressure, we further demonstrate the robustness of the optimized graph neural network to changes in various model parameters. Our research tries to provide a new way of extracting the information about the inter-particle forces, which substantially improves the efficiency and reduces the costs compared to the traditional experiments.