Attribute Error when trying to run for training in Google Colab

I am training for Object Detection using the Tensorflow Object Detection API Tutorial. here is the link:Tensorflow Object Detetction Docs Tutorial
but I am getting an error when I run: !python --model_dir=/content/drive/MyDrive/colab/Tensorflow/workspace/training_demo/models/my_ssd_resnet50_v1_fpn --pipeline_config_path=/content/drive/MyDrive/colab/Tensorflow/workspace/training_demo/models/my_ssd_resnet50_v1_fpn/pipeline.config and after I run that script I get this error: `AttributeError: in user code:

File "/usr/local/lib/python3.10/dist-packages/object_detection/data_decoders/", line 556, in decode  *
    tensors = decoder.decode(serialized_example, items=keys)
File "/usr/local/lib/python3.10/dist-packages/tf_slim/data/", line 722, in decode  *
File "/usr/local/lib/python3.10/dist-packages/tf_slim/data/", line 405, in tensors_to_item  *
    return self._decode(image_buffer, image_format)
File "/usr/local/lib/python3.10/dist-packages/tf_slim/data/", line 453, in _decode  *
    image =

AttributeError: module 'tensorflow.python.ops.control_flow_ops' has no attribute 'case'`

has anyone any clue on what did I do wrong there? I followed the Tensorflow Object Detection Docs tutorial step by step but I still do not understand why is giving me that error.

Hi @Aby,In the tutorial you are following i can see that they are using a research model for your object detection training, those models contain some deprecated lines of code. TensorFlow does not officially support research models.

I recommend you to use the official tensorflow/models for your use case. Please refer to this tutorial for implementing object detection using official models and let us know if you faceing any errors? Thank you.

1 Like

Hi Kiran, Thanks for the reply. I will try it out and let you know if it solved the issue.

Hi @Aby, have you managed to fix that? I am also trying to train the ssd tensorflow model on a custom dataset in Collab, but face the same error: AttributeError: module ‘tensorflow.python.ops.control_flow_ops’ has no attribute ‘case’. I also used research models. I couldn’t find the ssd nodel among the official models. Thank you for your reply!