Mine does this and I've replaced the battery.....still does it.....upped the idle speed, replaced the exhaust baffle, new air filter.......still does it..........if i just switch off the ignition and power up again then it will often start straight away.......sometimes it will take 2 power off and back ons.
Battery is usually the culprit but in my case I've been advised to go through all my electrical connectors and detach, spray and disconnect each one a few times as it could be a dodgy or corroded connection somewhere but i just haven't got round to doing it yet.