An image forming apparatus which is capable of performing a failsafe image forming operation even when a memory device of a replaceable unit mounted thereon is faulty. A controller of the image forming apparatus determines whether or not a memory tag of a toner cartridge is faulty. If the memory tag is determined to be faulty, the controller causes image adjustment to be executed.