diff --git a/official/projects/centernet/configs/centernet.py b/official/projects/centernet/configs/centernet.py index e42c0f4840..fb1663ec52 100644 --- a/official/projects/centernet/configs/centernet.py +++ b/official/projects/centernet/configs/centernet.py @@ -71,7 +71,7 @@ class DataConfig(cfg.DataConfig): is_training: bool = True dtype: str = 'float16' decoder: DataDecoder = dataclasses.field(default_factory=DataDecoder) - parser: Parser = Parser() + parser: Parser = dataclasses.field(default_factory=Parser) shuffle_buffer_size: int = 10000 file_type: str = 'tfrecord' drop_remainder: bool = True diff --git a/official/projects/text_classification_example/classification_example.py b/official/projects/text_classification_example/classification_example.py index d3c60194f6..61e6b9d4a2 100644 --- a/official/projects/text_classification_example/classification_example.py +++ b/official/projects/text_classification_example/classification_example.py @@ -47,7 +47,7 @@ class ClassificationExampleConfig(cfg.TaskConfig): # At most one of `init_checkpoint` and `hub_module_url` can be specified. init_checkpoint: str = '' hub_module_url: str = '' - model: ModelConfig = ModelConfig() + model: ModelConfig = dataclasses.field(default_factory=ModelConfig) num_classes = 2 class_names = ['A', 'B']