In this work, we utilize simulated annealing algorithm with neural network, to achieve rapid design of topological photonic crystals. We firstly train a high-accuracy neural network that predicts the band structure of hexagonal lattice photonic crystals. Subsequently, we embed the neural network into the simulated annealing algorithm, and choose the on-demand evaluation functions for optimizing topological band gaps. As examples, designing from the Dirac crystal of hexagonal lattice, two types of valley photonic crystals with the relative bandwidth of bandgap 26.8% and 47.6%, and one type of pseudospin photonic crystal with the relative bandwidth of bandgap 28.8% are obtained. In a further way, domain walls composed of valley photonic crystals (pseudospin photonic crystals) are also proposed, and full-wave simulations are conducted to verify the valley-locked (pseudospin-locked) edge states unidirectionally propagates under the excitation of circularly polarized source. Our proposed method demonstrates the efficiency and flexibility of neural network with simulated annealing algorithm in designing topological photonic crystals.