Unverified Commit 68d983b9 authored by vivek rathod's avatar vivek rathod Committed by GitHub
Browse files

Merged commit includes the following changes: (#8742)

318569851  by jonathanhuang:

    Fix for fine-tuning from classification checkpoints in the v2 binary.

--

PiperOrigin-RevId: 318569851
parent 6ef140dc
...@@ -2801,7 +2801,10 @@ class FasterRCNNMetaArch(model.DetectionModel): ...@@ -2801,7 +2801,10 @@ class FasterRCNNMetaArch(model.DetectionModel):
A dict mapping keys to Trackable objects (tf.Module or Checkpoint). A dict mapping keys to Trackable objects (tf.Module or Checkpoint).
""" """
if fine_tune_checkpoint_type == 'classification': if fine_tune_checkpoint_type == 'classification':
return {'feature_extractor': self.classification_backbone} return {
'feature_extractor':
self._feature_extractor.classification_backbone
}
elif fine_tune_checkpoint_type == 'detection': elif fine_tune_checkpoint_type == 'detection':
fake_model = tf.train.Checkpoint( fake_model = tf.train.Checkpoint(
_feature_extractor_for_box_classifier_features= _feature_extractor_for_box_classifier_features=
......
...@@ -1320,7 +1320,10 @@ class SSDMetaArch(model.DetectionModel): ...@@ -1320,7 +1320,10 @@ class SSDMetaArch(model.DetectionModel):
A dict mapping keys to Trackable objects (tf.Module or Checkpoint). A dict mapping keys to Trackable objects (tf.Module or Checkpoint).
""" """
if fine_tune_checkpoint_type == 'classification': if fine_tune_checkpoint_type == 'classification':
return {'feature_extractor': self.classification_backbone} return {
'feature_extractor':
self._feature_extractor.classification_backbone
}
elif fine_tune_checkpoint_type == 'detection': elif fine_tune_checkpoint_type == 'detection':
fake_model = tf.train.Checkpoint( fake_model = tf.train.Checkpoint(
_feature_extractor=self._feature_extractor) _feature_extractor=self._feature_extractor)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment