Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion paddle/fluid/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ cc_library(

if(WITH_PYTHON)
py_proto_compile(framework_py_proto SRCS framework.proto data_feed.proto)
py_proto_compile(trainer_py_proto SRCS trainer_desc.proto data_feed.proto)
py_proto_compile(trainer_py_proto SRCS trainer_desc.proto)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对比修改前后生成的 trainer_desc_pb2.py,一致吗?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

py_proto_compile(distributed_strategy_py_proto SRCS
distributed_strategy.proto)
py_proto_compile(pass_desc_py_proto SRCS pass_desc.proto)
Expand Down
13 changes: 1 addition & 12 deletions python/paddle/base/trainer_desc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
# limitations under the License.
"""Definition of trainers."""

import os
import sys

__all__ = []


Expand All @@ -31,15 +28,7 @@ def __init__(self):
with open(proto_file, 'r') as f:
text_format.Parse(f.read(), self.proto_desc)
'''
# Workaround for relative import in protobuf under python3
# TODO: should be fixed
cur_path = os.path.dirname(__file__)
if cur_path not in sys.path:
sys.path.append(cur_path)
if cur_path + "/proto" not in sys.path:
sys.path.append(cur_path + "/proto")

from proto import trainer_desc_pb2
from .proto import trainer_desc_pb2

self.proto_desc = trainer_desc_pb2.TrainerDesc()
import multiprocessing as mp
Expand Down
Loading