From 5b06944857e74f9b1388e081d4502bfd8c002832 Mon Sep 17 00:00:00 2001 From: Yancey Date: Mon, 7 May 2018 18:55:39 +0800 Subject: [PATCH] fix trainer import error on ce (#10448) * fix trainer import error on ce * fix setup.py.in --- python/paddle/fluid/__init__.py | 1 + python/paddle/fluid/trainer.py | 1 + python/setup.py.in | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/__init__.py b/python/paddle/fluid/__init__.py index 37d368946..c8a435748 100644 --- a/python/paddle/fluid/__init__.py +++ b/python/paddle/fluid/__init__.py @@ -60,6 +60,7 @@ __all__ = framework.__all__ + executor.__all__ + concurrency.__all__ +\ 'io', 'initializer', 'layers', + 'transpiler' 'nets', 'optimizer', 'learning_rate_decay', diff --git a/python/paddle/fluid/trainer.py b/python/paddle/fluid/trainer.py index a9fa2359e..1cbecd69e 100644 --- a/python/paddle/fluid/trainer.py +++ b/python/paddle/fluid/trainer.py @@ -19,6 +19,7 @@ import executor import data_feeder import contextlib import io +import transpiler # optimizer is same as the parameter of Trainer.__init__. Rename it to opt_module import optimizer as opt_module diff --git a/python/setup.py.in b/python/setup.py.in index a811b509a..c42601d33 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -68,7 +68,8 @@ packages=['paddle', 'paddle.fluid', 'paddle.fluid.proto', 'paddle.fluid.proto.profiler', - 'paddle.fluid.layers'] + 'paddle.fluid.layers', + 'paddle.fluid.transpiler'] if '${WITH_FLUID_ONLY}'== 'OFF': packages+=['paddle.proto', -- GitLab