Module 'tensorflow' has no attribute 'contrib' : <p>I am trying to train my own custom object detector using Tensorflow Object-Detection-API </p>

<p>I installed the tensorflow using "pip install tensorflow" in my google compute engine. Then I followed all the instructions on this site: <a href="https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html" rel="noreferrer">https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html</a> </p>

<p>When I try to use train.py I am getting this error message:</p>

<blockquote>
  <p>Traceback (most recent call last):
  File "train.py", line 49, in 
   from object_detection.builders import dataset_builder
  File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1->py3.6.egg/object_detection/builders/dataset_builder.py", line 27, in 
  from object_detection.data_decoders import tf_example_decoder
  File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/data_decoders/tf_example_decoder.py", line 27, in 
      slim_example_decoder = tf.contrib.slim.tfexample_decoder
  AttributeError: module 'tensorflow' has no attribute 'contrib'</p>
</blockquote>

<p>Also I am getting different results when I try to learn version of tensorflow.</p>

<blockquote>
  <p>python3 -c 'import tensorflow as tf; print(tf.<strong>version</strong>)' : 2.0.0-dev20190422</p>
</blockquote>

<p>and when I use</p>

<blockquote>
  <p>pip3 show tensorflow: </p>
  
  <p>Name: tensorflow
  Version: 1.13.1
  Summary: TensorFlow is an open source machine learning framework for everyone.
  Home-page: <a href="https://www.tensorflow.org/" rel="noreferrer">https://www.tensorflow.org/</a>
  Author: Google Inc.
  Author-email: opensource@google.com
  License: Apache 2.0
  Location: /usr/local/lib/python3.6/dist-packages
  Requires: gast, astor, absl-py, tensorflow-estimator, keras-preprocessing, grpcio, six, keras-applications, wheel, numpy, tensorboard, protobuf, termcolor
  Required-by: </p>
</blockquote>

<pre><code>    sudo python3 train.py --logtostderr --train_dir=training/ -- 
    pipeline_config_path=training/ssd_inception_v2_coco.config
</code></pre>

<p>What should I do to solve this problem? I couldn't find anything about this error message except this: <a href="https://stackoverflow.com/questions/38238192/tensorflow-module-object-has-no-attribute-contrib">tensorflow &#39;module&#39; object has no attribute &#39;contrib&#39;</a></p>
