The 23-time grand slam champion won the first three games of her much anticipated clash with Spain’s Garbine Muguruza in the California desert.
But she lost the next seven games and was trailing 3-6 0-1 when she called it a day.
“By the score, it might have looked like I started well, but I was not feeling at all well physically. I will focus on getting better and start preparing for Miami.”
Williams was competing in her first tournament since exiting the Australian Open at the quarter-final stage in January.
She was in fine form as she defeated former world No.1 Victoria Azarenka in the second round on Saturday.
Muguruza, a two-time grand slam champion ranked 20th in the world, will face seventh seed Kiki Bertens in the Indian Wells fourth round.