We consider the problem of inferring the probability distribution of flux configurations in metabolic network models from empirical flux data. For the simple case in which experimental averages are to be retrieved, data are described by a Boltzmann-like distribution ($propto e^{F/T}$) where $F$ is a linear combination of fluxes and the `temperature parameter $Tgeq 0$ allows for fluctuations. The zero-temperature limit corresponds to a Flux Balance Analysis scenario, where an objective function ($F$) is maximized. As a test, we have inverse modeled, by means of Boltzmann learning, the catabolic core of Escherichia coli in glucose-limited aerobic stationary growth conditions. Empirical means are best reproduced when $F$ is a simple combination of biomass production and glucose uptake and the temperature is finite, implying the presence of fluctuations. The scheme presented here has the potential to deliver new quantitative insight on cellular metabolism. Our implementation is however computationally intensive, and highlights the major role that effective algorithms to sample the high-dimensional solution space of metabolic networks can play in this field.