I have a Frozen graph for SSD Mobilnet V2 and trying to compute the following gradient
img_input = graph.get_tensor_by_name('image_tensor:0')
detection_scores = graph.get_tensor_by_name('detection_scores:0')
grads = tf.gradients(detection_scores,img_input)
But I am getting the error "AttributeError: 'NoneType' object has no attribute 'outer_context'" for Exit operation in the while loop of the graph. The while context where the Exit operation belongs is returning as None.
Any help is really appreciated. I am stuck with this issue for more than 2 weeks. The frozen graph is obtained by training the model using Tensorflow Object Detection API using TF1.