Wave-particle duality of photons with losses in the Mach-Zehnder interferometer (MZI) is investigated experimentally and theoretically. The experiment is done with the standard MZI with the beam splitter or the beam merger being continuously varied. The losses are deliberately introduced either inside the MZI (the two arms between the beam splitter and beam mergers) or outside the MZI (after the beam merger). It is proved that the unbalanced losses have great influence on the predictability $P$ (particle nature) and visibility $V$ (wave nature). For the former case the duality inequality holds while for the later the duality inequality is ``violated. We get $P^2+V^2>1$. This ``violation could be eliminated in principle by switching the two paths and detectors and then averaging the results. The observed results can be exactly explained theoretically. The experiment is done with coherent beam, instead of single photons, and we have proved that they are exactly equivalent in duality experiment with MZI.