2

I have a source code read CAPTCHA. When i run test, I got a problem on Windows 10

Traceback (most recent call last):
  File "train.py", line 48, in <module>
    from object_detection.builders import dataset_builder
  File "C:\Users\HuyHys\Anaconda3\lib\site-packages\object_detection\builders\dataset_builder.py", line 27, in <module>
    from object_detection.data_decoders import tf_example_decoder
  File "C:\Users\HuyHys\Anaconda3\lib\site-packages\object_detection\data_decoders\tf_example_decoder.py", line 27, in <module>
    slim_example_decoder = tf.contrib.slim.tfexample_decoder
AttributeError: module 'tensorflow' has no attribute 'contrib'

I found a ask on stackoverflow (visit Module 'tensorflow' has no attribute 'contrib')

But i can't fix this error. Pls, anyone can help me! How to fix detail this error???

Hồ Huy
  • 21
  • 1
  • 2
  • 4

1 Answers1

2

This Error occurs because tf.contrib is removed from TensorFlow 2. I guess you are using old code from Tensorflow 1 that is not compatible with the new Tenserflow 2. For more information checkout Migrate your TensorFlow 1 code to TensorFlow 2. If you need more help please share all code snippets where you use tf.contrib.