You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by jx...@apache.org on 2018/01/16 18:23:17 UTC
[incubator-mxnet] branch master updated: np.fromstring:
DeprecationWarning (#9445)
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 <la...@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
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].