Cosmic Ray Flux Measurement with AMANDA-II. The majority of events recorded by Antarctic Muon And Neutrino Detector Array (AMANDA) are caused by background muons which are produced in the atmosphere by the high-energy cosmic rays. These events can be simulated by Monte Carlo based on the measured flux of the cosmic rays at the top of the atmosphere. The leading uncertainties in such a simulation are caused by the choice of the high-energy model used for the first interaction of the cosmic rays, uncertainties in our knowledge of the ice properties at the depth of the detector, and individual optical module properties (sensitivities). The errors in the measured cosmic ray flux are also significant and propagate through the analysis. Contributions from uncertainties in the atmospheric conditions and muon cross sections in ice are smaller. A method is developed that results in a flux measurement of cosmic rays with energies 0.5-5 TeV per nucleon (assuming power law spectra for species H through Fe) independent of the ice model and optical module sensitivities. The largest uncertainty left is due to the high-energy interaction model. Predictions of six commonly-used models - QGSJET, VENUS, NEXUS, DPMJET, HDPM, and SYBILL - are examined and compared to data.