diff --git a/python/paddle/distributed/fleet/base/distributed_strategy.py b/python/paddle/distributed/fleet/base/distributed_strategy.py index 32785a084f201d2037b2e99573b19ba5fb71686c..fbe391b45f0559bf477d6e688c55e5accc6b807c 100755 --- a/python/paddle/distributed/fleet/base/distributed_strategy.py +++ b/python/paddle/distributed/fleet/base/distributed_strategy.py @@ -22,12 +22,6 @@ from paddle.distributed.fleet.utils.log_util import logger from paddle.fluid.framework import _global_flags from paddle.fluid.wrapped_decorator import wrap_decorator -protobuf_version = google.protobuf.__version__ -if protobuf_version >= "4.21.0": - import google._upb._message as _message -else: - import google.protobuf.pyext._message as _message - __all__ = [] non_auto_func_called = True @@ -2503,7 +2497,7 @@ class DistributedStrategy: for ff in config_fields: if isinstance( getattr(my_configs, ff.name), - _message.RepeatedScalarContainer, + google.protobuf.pyext._message.RepeatedScalarContainer, ): values = getattr(my_configs, ff.name) for i, v in enumerate(values):