In the fluorescence detection of ultra high energy (≳10eV) cosmic rays, the number of emitted fluorescence photons is assumed to be proportional to the energy deposited in air by shower particles. We have performed measurements of the fluorescence yield in atmospheric gases excited by electrons over energies ranging from keV to hundreds of MeV in several accelerators. We found that within the measured energy ranges the proportionality holds at the level of few %