The 12-dimensional ab initio potential for the water dimer with flexible monomers from Huang et al. (J. Chem. Phys. 2008, 128, 034312) was used in accurate calculations of the vibration-rotation-tunneling (VRT) levels of (H2O)2 and (D2O)2 involving the intermolecular rovibrational and tunneling states as well as the intramolecular vibrations. For the intermolecular VRT levels we used a 6 + 6d model in which the fast intramolecular vibrations are adiabatically separated from the much slower intermolecular vibrations, tunneling motions, and overall rotations. We also tested two six-dimensional (6d) rigid monomer models in which the monomers were frozen either at their equilibrium geometry or at their ground state vibrationally averaged geometry. All the results from the 6 + 6d model agree well with the large amount of detailed experimental data available from high-resolution spectroscopy. For most of the parameters characterizing the spectra the results of the two 6d rigid monomer models do not significantly differ from the 6 + 6d results. An exception is the relatively large acceptor tunneling splitting, which was the only quantity for which the 6d model with the monomers frozen at their equilibrium geometry was not in good agreement with the experimental data. The 6d model with monomers at their vibrationally averaged geometry performs considerably better, and the full 6 + 6d results agree with the measurements also for this quantity. For the excited intramolecular vibrations we tested two 6 + 6d models. In the first model the excitation was assumed to be either on the donor in the hydrogen bond or on the acceptor, and to hop from one monomer to the other upon donor-acceptor interchange. In the second model the monomer excitation remains localized on a given monomer for all dimer geometries. Almost the same frequencies of the intramolecular vibrations were found for the two models. The calculations show considerable variations in the frequencies of the intramolecular modes for transitions involving different tunneling levels and different values of the rotational quantum number K. For K = 0 --> 0 transitions these variations largely cancel, however. A comparison with experimental data is difficult, except for the acceptor asymmetric stretch mode observed in high-resolution spectra, because it is not clear how much the different transitions contribute to the (unresolved) peaks in most of the experimental spectra. The large red shift of the donor bound OH stretch mode is correctly predicted, but the value calculated for this red shift is too small by more than 20%. Also in the smaller shifts of the other modes we find relatively large errors. It is useful, however, that our detailed calculations including all ground and excited state tunneling levels provide an explanation for the splitting of the acceptor asymmetric stretch band observed in He nanodroplet spectra, as well as for the fact that the other bands in these spectra show much smaller or no splittings.