You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/04/27 00:49:22 UTC

[GitHub] yajiedesign commented on a change in pull request #10697: [MXNET-360]auto convert str to bytes in img.imdecode when py3

yajiedesign commented on a change in pull request #10697: [MXNET-360]auto convert str to bytes in img.imdecode when py3
URL: https://github.com/apache/incubator-mxnet/pull/10697#discussion_r184568671
 
 

 ##########
 File path: python/mxnet/image/image.py
 ##########
 @@ -132,6 +134,9 @@ def imdecode(buf, *args, **kwargs):
     <NDArray 224x224x3 @cpu(0)>
     """
     if not isinstance(buf, nd.NDArray):
+        if sys.version_info[0] == 3:
+            if isinstance(buf, str):
+                buf = bytes(buf, "ascii")
 
 Review comment:
    mx.base.py_str is 'utf8' encoding,I'm not sure it can work.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services