The reason I ask about whether you have a derailleur or an internally geared hub, is because I had a problem with the internally geared hub where it started not going into gear, like it was fine in 5th, but when I went into 6th, it suddenly didn't seem to be in any gear at all. I geared down to 4th and it was clearly working fine again, but it wouldn't go into higher gears. Shortly it wouldn't go into anything higher than 3rd gear. Back to LBS, and it turned out the cable to the gear shifter needed tweaking.
The point being, that it felt like the motor was cutting out, when it was the gears not shifting correctly.