tensorflow / tensorflow/models

Unable to freeze weights in object detection model

Open
#9,857 5 comments 4 reactions 3 assignees View on GitHub

Nobody has claimed this yet.

models:research:odapi
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

With reference to #2203 , I am trying to perform object detection with the ssd mobienet model and I am trying to freeze the weights.
Upon printing the layers with print(detection_models.trainable_variables) I get
image

Without freezing,
I get 232 trainable weights and 152 non trainable weights.
len(detection_model.trainable_weights), len(detection_model.non_trainable_weights)
I am trying to add the
freeze_variables: ".* ssd_mobile_net_v2fpn_keras_feature_extractor.* " and change the freeze_batchnorm parameter to true
tinthe train_config and then print the number of trainable weights.

I get the same values of 232 trainable weights and 152 non trainable weights.
len(detection_model.trainable_weights), len(detection_model.non_trainable_weights)

How can I check if the layer is actually frozen?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.