diff --git a/paddle/fluid/inference/tests/api/full_ILSVRC2012_val_preprocess.py b/paddle/fluid/inference/tests/api/full_ILSVRC2012_val_preprocess.py index ad72a89eca9b738ebffe188e903178ff71d23a3e..adb6aa4d75344d767ce44019f3c1162956087210 100644 --- a/paddle/fluid/inference/tests/api/full_ILSVRC2012_val_preprocess.py +++ b/paddle/fluid/inference/tests/api/full_ILSVRC2012_val_preprocess.py @@ -167,8 +167,8 @@ def run_convert(): os.path.getsize(output_file) == FULL_SIZE_BYTES): if os.path.exists(output_file): sys.stderr.write( - "\n\nThe existing binary file is broken. Start to generate new one...\n\n" - ) + "\n\nThe existing binary file[{}] is broken. Start to generate new one...\n\n". + format(output_file)) os.remove(output_file) if retry < try_limit: retry = retry + 1 diff --git a/python/paddle/fluid/tests/unittests/test_gradient_clip.py b/python/paddle/fluid/tests/unittests/test_gradient_clip.py index f258e830b5fe5f89ec419e1192fae37c5205db34..14f5d4a41a1fed1a81436d0372759db86fc7d1a0 100644 --- a/python/paddle/fluid/tests/unittests/test_gradient_clip.py +++ b/python/paddle/fluid/tests/unittests/test_gradient_clip.py @@ -133,7 +133,7 @@ class TestGradientClip(unittest.TestCase): print(val) self.assertFalse(np.isnan(val)) - def backward_and_optimize(cost): + def backward_and_optimize(self, cost): pass diff --git a/python/paddle/fluid/transpiler/collective.py b/python/paddle/fluid/transpiler/collective.py index ef6975c3d241e5de0a4dab17e88ebf6896472f32..308a876977cf4f11ba3a79f08c4729268121e6e2 100644 --- a/python/paddle/fluid/transpiler/collective.py +++ b/python/paddle/fluid/transpiler/collective.py @@ -434,9 +434,10 @@ class MultiThread(GradAllReduce): print("total endpoints: ", self.endpoints) print("rank: %d, ring_id: %d" % (self.rank, self.nrings)) for ring_id in range(self.nrings): - self._init_communicator( - self.startup_program, self.current_endpoint, self.endpoints, - self.rank, ring_id, self.wait_port, True) + self._init_communicator(self.startup_program, + self.current_endpoint, self.endpoints, + self.rank, ring_id, self.wait_port) + else: print("begin to _transpile_startup_program for single-node") block = self.startup_program.global_block()