Commit 2a26552c authored by Liangzhe Yuan's avatar Liangzhe Yuan Committed by A. Unique TensorFlower
Browse files

#movinet set NormActivation.activation = None by default and gauge its use case.

PiperOrigin-RevId: 416126695
parent fceb3ca9
...@@ -126,7 +126,7 @@ class MovinetModel(video_classification.VideoClassificationModel): ...@@ -126,7 +126,7 @@ class MovinetModel(video_classification.VideoClassificationModel):
model_type: str = 'movinet' model_type: str = 'movinet'
backbone: Backbone3D = Backbone3D() backbone: Backbone3D = Backbone3D()
norm_activation: common.NormActivation = common.NormActivation( norm_activation: common.NormActivation = common.NormActivation(
activation='swish', activation=None, # legacy flag, not used.
norm_momentum=0.99, norm_momentum=0.99,
norm_epsilon=1e-3, norm_epsilon=1e-3,
use_sync_bn=True) use_sync_bn=True)
......
...@@ -709,8 +709,12 @@ def build_movinet( ...@@ -709,8 +709,12 @@ def build_movinet(
"""Builds MoViNet backbone from a config.""" """Builds MoViNet backbone from a config."""
backbone_type = backbone_config.type backbone_type = backbone_config.type
backbone_cfg = backbone_config.get() backbone_cfg = backbone_config.get()
assert backbone_type == 'movinet', ('Inconsistent backbone type ' if backbone_type != 'movinet':
f'{backbone_type}') raise ValueError(f'Inconsistent backbone type {backbone_type}')
if norm_activation_config.activation is not None:
raise ValueError(
'norm_activation is not used in MoViNets, but specified: %s' %
norm_activation_config.activation)
return Movinet( return Movinet(
model_id=backbone_cfg.model_id, model_id=backbone_cfg.model_id,
......
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