Abstract Qualified thermal management is an important guarantee for the stable work of electronic devices. However, the increasingly complex cooling structure needs several hours or even longer to simulate, which hinders finding the optimal heat dissipation design in the limited space. Herein, an approach based on conditional generative adversarial network (cGAN) is reported to bridge complex geometry and physical field. The established end-to-end model not only predicted the maximum temperature with high precision but also captured real field details in the generated image. The impact of amount of training data on model prediction performance was discussed, and the performance of the models fine-tuned and trained from scratch was also compared in the case of less training data or using in new electronic devices. Furthermore, the high expansibility of geometrically encoded labels makes this method possible to be used in the heat dissipation analysis of more electronic devices. More importantly, this approach, compared to the grid-based simulation, accelerates the process by several orders of magnitude and saves a large amount of energy, which can vastly improve the efficiency of the thermal management design of electronic devices.