tensorflow / models

Models and examples built with TensorFlow
Other
77.04k stars 45.77k forks source link

No effect of 'freeze_variables' in TensorFlow Objection API when using Tensorflow 2 #9548

Open eilifsolberg opened 3 years ago

eilifsolberg commented 3 years ago

Prerequisites

Please answer the following questions for yourself before submitting an issue.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/tree/master/research/...

2. Describe the bug

The 'freeze_variables' parameter in https://github.com/tensorflow/models/blob/master/research/object_detection/protos/train.proto

does not seem to have any effect when using TensorFlow 2. When setting 'freeze_variables' to '.*', which should freeze all variables, the model variables still show up in detection_model.trainable_variables when performing gradient calculation in https://github.com/tensorflow/models/blob/master/research/object_detection/model_lib_v2.py

It seems like 'freeze_variables' is only used in the old tf1 code https://github.com/tensorflow/models/blob/master/research/object_detection/model_lib.py

mohammedayub44 commented 3 years ago

I'm looking for something similar to reduce my train time. Any update on this ?

di0002ya commented 3 years ago

Any update?