[Solved]: Module 'tensorflow' has no attribute 'contrib'

tf.contrib has moved out of TF starting TF 2.0 alpha.
Take a look at these tf 2.0 release notes 


You can upgrade your TF 1.x code to TF 2.x using the tf_upgrade_v2 script 


if you want o=to work on older version then you can specify that version with pip

$ pip install tensorflow==1.13.1