We present a deep energy method (DEM) to solve functionally graded porous beams. We use the Euler-Bernoulli assumptions with varying mechanical properties across the thickness. DEM is subsequently developed, and its performance is demonstrated by comparing the analytical solution, which was adopted from our previous work. The proposed method completely eliminates the need of a discretization technique, such as the finite element method, and optimizes the potential energy of the beam to train the neural network. Once the neural network has been trained, the solution is obtained in a very short amount of time.