'TypeError: 'AutoTrackable' object is not callable

I am trying to run inference on my trained model following this tutorial. I am using TF 2.1.0 and I have tried with tf-nightly 2.5.0.dev20201202. But I get TypeError: 'AutoTrackable' object is not callable when I hit the following line detections = detect_fn(input_tensor)
I am aware that 'AutoTrackable' object is not callable in Python exists but I am not using tensorflow hub and I don't understand how the answer could help me.

Thanks



Solution 1:[1]

Try using detect_fn.signatures\['default'](input_tensor)

Solution 2:[2]

Changing detections = detect_fn(input_tensor) to detections = detect_fn.signatures['serving_default'](input_tensor) fixed the issue for me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Majid Hajibaba
Solution 2 Matin H