2.2.0 execution of tensor flow

I m running this code in tfv2 but showing this error please help me to resolve

import tensorflow as tf

config = tf.estimator.RunConfig(tf_random_seed=42) # not shown in the config

feature_cols = tf.contrib.learn.infer_real_valued_columns_from_input(X_train)
dnn_clf = tf.contrib.learn.DNNClassifier(hidden_units=[200, 200, 200], n_classes=10,
feature_columns=feature_cols, config=config)
dnn_clf = tf.contrib.learn.SKCompat(dnn_clf) # if TensorFlow >= 1.1
dnn_clf.fit(X_train, y_train, batch_size=50, steps=40000)

AttributeError: module ‘tensorflow’ has no attribute ‘contrib’