Gain-phase impairments (GPIs) affect both communication and sensing in 6G integrated sensing and communication (ISAC). We study the effect of GPIs in a single-input, multiple-output orthogonal frequency-division multiplexing ISAC system and develop a model-based unsupervised learning approach to simultaneously (i) estimate the gain-phase errors and (ii) localize sensing targets. The proposed method is based on the optimal maximum a-posteriori ratio test for a single target. Results show that the proposed approach can effectively estimate the gain-phase errors and yield similar position estimation performance as the case when the impairments are fully known.