Officers on routine patrol found the 21-month-old child in Prosser Street, Park Village, Wolverhampton, on Monday afternoon.
As they were returning the child home, officers discovered around 100 cannabis plants growing in the bedroom and loft.
A 24-year-old man was later arrested and charged with cultivation of cannabis. He will appear at court next month.
A spokesman for West Midlands Police said: "Officers on routine patrol found a child on Prosser Street in Wolverhampton yesterday afternoon [February 15].
"The child was returned home and while officers were at the address making enquiries they discovered around 100 cannabis plants.
"A 24-year-old man was arrested and later charged with cultivation of cannabis and bailed to appear before Dudley Magistrates Court on March 14."
Heath Town & East Park Police posted on Twitter about the incident, adding: "Find 21-month-old walking in road. Return him home, and find cannabis grow over 200 plants in bedroom and loft."