Did you use the same USB port? Did you use other USB devices on that port? That's what confounds the operating system. The technology isn't perfect yet.
The easiest solution is to get a cheap USB card reader and use that to connect your camera's memory card directly to your computer's USB slot. That is the only recommended method. The camera acts as a USB card reader when connected to the computer but since it doesn't specifically identifies itself as one, the computer will eventually fail to identify it correctly.
Using a USB card reader eliminates all camera to computer connection problems.
Now you know!