From f7d0d99f936a9288855c7d15263378473ab8c4b9 Mon Sep 17 00:00:00 2001 From: liaogang Date: Sat, 6 May 2017 19:16:43 +0800 Subject: [PATCH] 'numpy.ndarray' object has no attribute 'tobytes' --- python/paddle/v2/parameters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/v2/parameters.py b/python/paddle/v2/parameters.py index d686d09f220..64805d0c504 100644 --- a/python/paddle/v2/parameters.py +++ b/python/paddle/v2/parameters.py @@ -249,7 +249,7 @@ class Parameters(object): size = reduce(lambda a, b: a * b, param.shape) f.write(struct.pack("IIQ", 0, 4, size)) param = param.astype(np.float32) - f.write(param.tobytes()) + f.write(param.tostring()) def deserialize(self, name, f): """ -- GitLab