The Riemann problem is fundamental to most computational fluid dynamics (CFD) codes for simulating compressible flows. The time to obtain the exact solution to this problem for real fluids is high because of the complexity of the fluid model, which includes the equation of state; as a result, approximate Riemann solvers are used in lieu of the exact ones, even for ideal gases. We used fully connected feedforward neural networks to find the solution to the Riemann problem for calorically imperfect gases (CI), supercritical fluids (SF), and high explosives (HE), and then embedded these network into a one-dimensional finite volume CFD code. We showed that for real fluids, the neural networks can be more than 5 orders of magnitude faster than the exact solver, with prediction errors below 0.8%. The same neural networks embedded in a CFD code yields very good agreement with the overall exact solution, with a speed-up of three orders of magnitude with respect to the same CFD code that use the exact Riemann solver to resolve the flux at the interfaces. Compared to the Rusanov flux reconstruction method, the neural network is half as fast, but yields a higher accuracy and is able to converge to the exact solution with a coarser grid.