GDP deflator and CPI are both used to measure inflation in an economy. GDP deflator measures the price changes of all goods and services produced in the economy, while CPI measures the price changes of goods and services purchased by households. CPI is more focused on consumer prices and assigns fixed weights to goods, so it can overstate inflation, while GDP deflator assigns changing weights and may understate inflation. Both measures generally agree on the overall inflation trend, but may diverge in specific cases like a crop failure, which would impact CPI more than GDP deflator.