No. In Exodus 20:4-6 the subject is idolatry. Regarding those who commit idolatry, we learn that God would visit the iniquity of the fathers upon the children to the third and fourth generations of those who hate Him. Notice, the text says "generations of those who hate Me." Therefore, we see that God would punish those who imitate their fathers' idolatrous actions. In other words, there are sinful patterns that children see in their parents that they often times replicate in their own lives. It is not that God has placed a curse on the people. It is not as if the children are obedient to God but God still punishes them because of their parents' disobedience. The point is that they are idol worshipers just like their parents were. In fact, verse 6 shows that God shows mercy to those who love Him, irregardless of their parents' disposition towards God. The contrast that we have in verses 4 and 5 is between those who hate God and those who love Him. The reason for it affecting the third and fourth generations is that the effects of idol worship is that it leads to children becoming accustomed to it, and they often times replicate it in their own lives.
Other passages to consider are listed below: