Nonadiabatic molecular dynamics simulations are one of the most important theoretical tools to study fundamental processes, such as photosynthesis or vision, but they are seriously limited by the expense of the underlying quantum chemistry calculations. Long nonadiabatic molecular dynamics simulations are out of reach when based on conventional ab initio methods, and the exploration of rare reaction channels is limited due to bad statistics. Here, the aforementioned limitations are circumvented by using machine learning models that can learn the relationship between a molecular structure and its photochemical properties computed with quantum chemistry in order to simulate nonadiabatic molecular dynamics on long time scales with ab initio accuracy. A central goal is to describe and highlight the challenges that arise when treating excited states and to provide a guide on how to generate a training set in a most efficient way. The machine learning models need to learn not only energies and forces but also couplings between the different electronic states. The photodynamics of a test system, the methylenimmonium cation, CH2NH2+, is used to show that machine learning models can accurately reproduce and speed up nonadiabatic dynamics simulations and can go beyond the abilities of conventional approaches to make long time scales in the range of nanoseconds possible. The chapter is focused on neural networks, but it provides a comparison of different types of regressors and representations to tackle excited-state properties.