Why is inference time so slow when using tensorflow.compat.v1?

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: No
  • TensorFlow installed from (source or binary): source(pip install)
  • TensorFlow version (use command below): TFv1(1.13.1 / 1.14.0 /1.15.4), TFv2(2.7.0)
  • Python version: Python 3.6(TFv1), Python 3.7(TFv2)
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version: CUDA 11.3 / cuDNN 8.2.1
  • GPU model and memory: GTX 1080ti 11G

You can also obtain the TensorFlow version with:

  1. TF 1.0: 1.13.1 / 1.14.0 / 1.15.4
  2. TF 2.0: 2.7.0

Describe the current behavior
Inference time is slow when loading and inferring models using tf.compat.v1.
I tested 4 cases about one model.
the model is one of tensorflow object detection model zoo and trained using own dataset(fine tuning).

1 case) inference using TF 1.13.1 → inference time : 0.05
2 case) inference using TF 1.14.0 → inference time : 0.05
3 case) inference using TF 1.15.4 → inference time : 0.27
4 case) inference using TF 2.7.0 → inference time : 0.27

Looking at the above results, I think version of tf.compat.v1 is 1.15.4.
Can I change version of tf.compat.v1 from 1.15 → 1.14?

Our company solution is using tensorflow 1.13 to load and infer models. And I am migrating to tf2 to support RTX 3000 series.

Describe the expected behavior

Expected result,
1 case) inference using TF 1.13.1 → inference time : 0.05
2 case) inference using TF 1.14.0 → inference time : 0.05
3 case) inference using TF 1.15.4 → inference time : 0.05
4 case) inference using TF 2.7.0 → inference time : 0.05

PS

I found two things.
One uses the “ssd resnet 50” pretrained model.
The other has different number of nodes and inference time between the weight file and the weight file of the model zoo.(our_weight.txt, ssd_resnet50.txt)

  • average inference time (tensorflow_gpu==1.13.1):
    our weight - 0.054s
    ssd_resnet50 - 0.067s
  • average inference time (tensorflow_gpu==1.15.0):
    our weight - 0.27s
    ssd_resnet50 - 0.06s

I think that the weights have different nodes belong to release version.
e.g.)

Therefore, I want to download following.( I don’t know pre_trained model release version )

  1. I want to download a repository of a specific tree (branch).
    e.g.) GitHub - tensorflow/models at 23b5b4227dfa1b23d7c21f0dfaf0951b16671f43
  2. I would like to download the old version of the weights file if it exists.

Can I download it?
If possible, how can I download it?