Machine learning (ML) has been well applied to studying equilibrium phase transition models by accurately predicating critical thresholds and some critical exponents. Difficulty will be raised, however, for integrating ML into nonequilibrium phase transitions. The extra dimension in a given nonequilibrium system, namely time, can greatly slow down the procedure toward the steady state. In this paper we find that by using some simple techniques of ML, non-steady-state configurations of directed percolation (DP) suffice to capture its essential critical behaviors in both ( 1+1 ) and ( 2+1 ) dime...