1. An image forming apparatus comprising: a sheet conveying portion configured to convey a sheet; a plurality of image forming units arranged in alignment along a conveyance direction in which the sheet is conveyed by the sheet conveying portion, the image forming units being configured to form an image by using developer on the sheet conveyed by the sheet conveying portion; a plurality of attachment portions which are provided in correspondence with the plurality of image forming units and to which a plurality of developer storage portions are attached, the developer storage portions storing the developer to be supplied to the image forming units; a plurality of lock mechanisms configured to regulate attachment and detachment of the developer storage portions attached to the attachment portions; a first detection processing portion configured to detect, for each of the developer storage portions attached to the attachment portions, whether or not that developer storage portion is in a specific state in which a remaining amount of developer is smaller than a predetermined reference amount; a first release processing portion configured to, when the first detection processing portion has detected that a developer storage portion is in the specific state, cause the lock mechanisms to release a regulation on attachment and detachment of the developer storage portion detected to be in the specific state; a second detection processing portion configured to detect whether or not any of the image forming units has an abnormality; and a second release processing portion capable of, when the second detection processing portion has detected that an image forming unit has an abnormality, releasing a regulation by the lock mechanisms on attachment and detachment of two or more developer storage portions corresponding to two or more image forming units that include at least an image forming unit adjacent to the image forming unit detected to have the abnormality.