In this paper, two types of optical magnetic field sensors have been prepared, one was pure garnet magnetic field sensor, another was garnet with Ta/NdFeB/Ta film grown by magnetron sputtering method at the base pressure of 1.0×10-5Pa, and the working pressure was 0.8Pa. Ta film worked as buffer layer and protective layer, and the NdFeB worked as ferromagnetic film, the atom proportion of NdFeB was 2:14:1. The measuring was based on Magneto-optical Faraday effect. The Faraday rotation was obtained under the conditions of 1.55μm near-infrared light and the magnetic field in range of -150-150Oe. It was found that the garnet sensor with NdFeB film has lower linearity error 0.125% compared with pure garnet sensor 1.42%, and the difference was attributed to the presence of NdFeB ferromagnetic film interact on the garnet.