Preheat the oven to 350°F (175°C)
Grease and line two 8-inch round cake pans
Grate 2 to 3 cups of carrots
In a bowl, whisk together 2 cups all-purpose flour, 2 teaspoons baking powder, 1 teaspoon baking soda, 1 teaspoon cinnamon, and 1/2 teaspoon salt
In another bowl, beat 1 cup granulated sugar, 1 cup brown sugar, and 1 cup vegetable oil
Add 4 eggs one at a time and mix well
Stir in 1 teaspoon vanilla extract
Fold the dry ingredients into the wet ingredients
Add the grated carrots
Mix in 1 cup chopped walnuts or pecans if desired
Pour the batter into the prepared pans
Bake for 30 to 40 minutes
Check doneness with a toothpick
Let the cakes cool in the pans for 10 minutes
Transfer the cakes to a wire rack to cool completely
Beat 8 ounces cream cheese, 1/2 cup butter, 3 to 4 cups powdered sugar, and 1 teaspoon vanilla extract to make frosting
Spread frosting between the cake layers and over the top and sides
Chill before serving if desired
