She told reporters that she cannot serve because of the injury.
"You always live to fight for another chance," Williams posted Monday morning on Instagram. "I've done a lot of fighting and this is just the beginning. Thank you a for the support. I love you."
Williams was due to face Sharapova in a round of 16 matchup Monday on Court Philippe-Chatier. She was also on a quest to win her 24th Grand Slam.
"I'm beyond disappointed," Williams said in a news conference. "I gave up so much from time with my daughter and time with my family all for this moment. So it's really difficult to be in this situation."
"It's very difficult because I love playing Maria," Serena Williams said. "It's a match I always get up for. It's extremely disappointing but I made a promise to myself that if I'm not at least 50 percent, I shouldn't play."