The UV (from young stars) and IR (from dust) emissions in galaxies are strongly physically linked: UV photons from young stars heat very efficiently the dust which re-emits the absorbed energy in IR. Therefore both quantities are star formation tracers but they are anti-correlated by the process of dust attenuation. Measuring reliable star formation rates and having robust measurements of dust attenuation is only possible when both quantities (UV and IR emissions) are available. However, even in this case, the selection applied to the sample can strongly modify the results. In this talk I will report results on our analyses of UV and IR selected samples of galaxies from z=0 to z~2, based on Herschel and AKARI surveys. I will show that dust attenuation is much higher in an IR selection than in a UV one and that both have a similar evolution with redshift. I will propose a simple explanation of these results if the stellar mass is considered as the main driver for dust attenuation.