This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 59700b0  np.fromstring: DeprecationWarning (#9445)
59700b0 is described below

commit 59700b0ffeb5a19273e212f38695a9499dce56a7
Author: Valeriu Lacatusu <lacatusu.vale...@gmail.com>
AuthorDate: Tue Jan 16 19:23:13 2018 +0100

    np.fromstring: DeprecationWarning (#9445)
    
    The binary mode of fromstring is deprecated, as it behaves surprisingly on 
unicode inputs. Use frombuffer instead
    img = np.fromstring(s, dtype=np.uint8)
---
 python/mxnet/recordio.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/mxnet/recordio.py b/python/mxnet/recordio.py
index 39f442b..7adb0b5 100644
--- a/python/mxnet/recordio.py
+++ b/python/mxnet/recordio.py
@@ -409,7 +409,7 @@ def unpack_img(s, iscolor=-1):
             [166, 167, 165]]], dtype=uint8)
     """
     header, s = unpack(s)
-    img = np.fromstring(s, dtype=np.uint8)
+    img = np.frombuffer(s, dtype=np.uint8)
     assert cv2 is not None
     img = cv2.imdecode(img, iscolor)
     return header, img

-- 
To stop receiving notification emails like this one, please contact
['"comm...@mxnet.apache.org" <comm...@mxnet.apache.org>'].

Reply via email to