1. An image forming apparatus comprising: a belt; a plurality of rollers for stretching said belt; a mechanism for generating a force, at an end portion of said belt, in a direction in which lateral deviation of said belt is corrected; a forming device for forming a toner image on said belt; a first sensor capable of detecting a density of the toner image formed on said belt on one end side of said belt; a second sensor capable of detecting the density of the toner image formed on said belt on the other end side of said belt; and a control device for selecting one of said first and second sensors which provides a smaller variation in a result of detection when said belt is free from the toner image, and for controlling an image forming condition of said forming device on the basis of a detection result of the density of the toner image by said selected sensor.