tf.contrib.slim , AttributeError: module 'tensorflow' has no attribute 'contrib'

28 views Asked by At

Code Snippet:

import functools import tensorflow as tf from object_detection.core import box_predictor from object_detection.utils import static_shape

slim = tf.contrib.slim

Error Message:

Traceback (most recent call last): File "E:\uav\TFODCourse\Tensorflow\models\research\object_detection\builders\model_builder_tf2_test.py", line 24, in from object_detection.builders import model_builder File "E:\uav\TFODCourse\tfod\lib\site-packages\object_detection\builders\model_builder.py", line 22, in from object_detection.builders import box_predictor_builder File "E:\uav\TFODCourse\tfod\lib\site-packages\object_detection\builders\box_predictor_builder.py", line 22, in from object_detection.predictors import mask_rcnn_box_predictor File "E:\uav\TFODCourse\tfod\lib\site-packages\object_detection\predictors\mask_rcnn_box_predictor.py", line 21, in

slim = tf.contrib.slim AttributeError: module 'tensorflow' has no attribute 'contrib'

I am running a Custom Object Detection Model on Jupyter Notebook for tensorflow version of 2.15.0<=.

Can anyone help me to debug the error without switching to TF1.X? Thank You

I have tried the solution provided earlier on the forum regarding the same i.e. to downgrade from TF2.0 to TF1.0 and like wise every solution but getting the same error.

0

There are 0 answers