The main reason for this can be that the female flowers aren't being pollinated. This could be due to a lack of agents such as bees and insects. But you can always self-pollinate, as mentioned in the article. It could also be because of too much heat, and you need to provide the pumpkins with shelter. Overly moist soil and drought conditions can also play a part. Only proper care can resolve this issue.