Polarimetry of the polarized proton and deuteron beams at intermediate energies