AttributeError: module 'tensorflow.python.ops.control_flow_ops' has no attribute 'case'`
I am facing an error while training a TensorFlow custom object detection model. Initially, I started with TensorFlow 2.13.0, but the GPU was not detected. Therefore, I upgraded to TensorFlow 2.15.0.
File "/usr/local/lib/python3.10/dist-packages/object_detection/data_decoders/tf_example_decoder.py", line 556, in decode * tensors = decoder.decode(serialized_example, items=keys) File "/usr/local/lib/python3.10/dist-packages/tf_slim/data/tfexample_decoder.py", line 722, in decode * outputs.append(handler.tensors_to_item(keys_to_tensors)) File "/usr/local/lib/python3.10/dist-packages/tf_slim/data/tfexample_decoder.py", line 405, in tensors_to_item * return self._decode(image_buffer, image_format) File "/usr/local/lib/python3.10/dist-packages/tf_slim/data/tfexample_decoder.py", line 453, in _decode * image = control_flow_ops.case(
AttributeError: module 'tensorflow.python.ops.control_flow_ops' has no attribute 'case'`
@ShubhamModi77 I came across this issue and would love to work on it. Looks like the problem is due to control_flow_ops.case, which isn’t available in TensorFlow 2.15. A quick fix would be swapping it with tf.case to make it compatible.
If it’s cool with you, I can start working on this and send a PR after testing.
@laxmareddyp Hey, can i get an update on my response, I'm eager to work on this issues