Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix protobuf import pyext._message error #49673

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion python/paddle/distributed/fleet/base/distributed_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
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
Expand Down Expand Up @@ -2497,7 +2503,7 @@ def __repr__(self):
for ff in config_fields:
if isinstance(
getattr(my_configs, ff.name),
google.protobuf.pyext._message.RepeatedScalarContainer,
_message.RepeatedScalarContainer,
):
values = getattr(my_configs, ff.name)
for i, v in enumerate(values):
Expand Down