Joke09 commented on issue #13545: For inference, I have the same problem. The 
client send jpg to server, then the server use cv2 to do resize. When put the 
image data into the mx.nd.array, it's very slow. And the Utilization of GPU is 
low too. How to solve it? Thank you!
URL: 
https://github.com/apache/incubator-mxnet/issues/13545#issuecomment-445138557
 
 
   > convert numpy.array to raw binary and then `image.decode`
   
   Thank you very much!
   Can you give me some code example?
   I use like this:
   ```
   im = cv2.read("a.jpg")
   im = cv2.resize(im, None, None, fx=im_scale, fy=im_scale)
   ...
   image = mx.img.imdecode(im)
   ```
   But it's fail.
   
     File "test.py", line 12, in <module>
       image = mx.img.imdecode(im)
     File "/data/usr/incubator-mxnet/python/mxnet/image/image.py", line 142, in 
imdecode
       return _internal._cvimdecode(buf, *args, **kwargs)
     File "<string>", line 36, in _cvimdecode
     File "/data/usr/incubator-mxnet/python/mxnet/_ctypes/ndarray.py", line 98, 
in _imperative_invoke
       stype=out_stypes[0])
     File "/data/usr/incubator-mxnet/python/mxnet/ndarray/sparse.py", line 
1185, in _ndarray_cls
       raise Exception("unknown storage type: %s"%stype)
   Exception: unknown storage type: -1
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to