diff --git a/python/paddle/distributed/fleet/meta_optimizers/localsgd_optimizer.py b/python/paddle/distributed/fleet/meta_optimizers/localsgd_optimizer.py index 3340672e0f925b11948e1751afdbeb3f9f642836..9052111d22c2eb9fa7bc2c0723a75f4a520611b4 100644 --- a/python/paddle/distributed/fleet/meta_optimizers/localsgd_optimizer.py +++ b/python/paddle/distributed/fleet/meta_optimizers/localsgd_optimizer.py @@ -16,6 +16,7 @@ from __future__ import print_function import paddle from paddle.fluid import program_guard, layers, default_main_program +from paddle.fluid import default_startup_program from .meta_optimizer_base import MetaOptimizerBase from .common import OpRole, OP_ROLE_KEY, CollectiveHelper, is_update_op diff --git a/python/paddle/fluid/dataloader/flat.py b/python/paddle/fluid/dataloader/flat.py index db3a725ece01c2508059458d542aedda3db228e9..32c8ef02dd915b64521a77934f800dc6f9b83c52 100644 --- a/python/paddle/fluid/dataloader/flat.py +++ b/python/paddle/fluid/dataloader/flat.py @@ -120,7 +120,7 @@ def _restore_batch(flat_batch, structure): elif isinstance(field, (Sequence, Mapping)): field_idx = _restore(structure[k], field_idx) else: - raise TypeError("wrong flat data type: {}".format(type(batch))) + raise TypeError("wrong flat data type: {}".format(type(structure))) return field_idx diff --git a/python/paddle/fluid/distributed/fleet.py b/python/paddle/fluid/distributed/fleet.py index 8f3d2defb9f0631098de3fb9ee1fa7b1abdeb884..cd2611956850ff15d220d866aa3064b101d013c5 100644 --- a/python/paddle/fluid/distributed/fleet.py +++ b/python/paddle/fluid/distributed/fleet.py @@ -13,6 +13,7 @@ import sys from .. import core from . import ps_instance +from google.protobuf import text_format __all__ = ['Fleet'] diff --git a/python/paddle/fluid/tests/unittests/test_group_norm_op.py b/python/paddle/fluid/tests/unittests/test_group_norm_op.py index 0ac8def94d017c95b20cb8c8cee2533715c466c3..61a51d9b5dd86628ebd28dee947ef5c59afd9277 100644 --- a/python/paddle/fluid/tests/unittests/test_group_norm_op.py +++ b/python/paddle/fluid/tests/unittests/test_group_norm_op.py @@ -46,7 +46,7 @@ class TestGroupNormOpError(unittest.TestCase): def test_x_type(): input = np.random.random(2, 100, 3, 5).astype('float32') - goups = 2 + groups = 2 fluid.layers.group_norm(input, groups) self.assertRaises(TypeError, test_x_type) diff --git a/python/paddle/optimizer/momentum.py b/python/paddle/optimizer/momentum.py index 85c5c60a34c50083e30eee65c3ad151d4516edc5..38ca21a3df4c74f0f9e4e979e414590867b72bfb 100644 --- a/python/paddle/optimizer/momentum.py +++ b/python/paddle/optimizer/momentum.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import warnings + from .optimizer import Optimizer from ..fluid import core from ..fluid import framework