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-444717557
 
 
   > Hi @Joke09 ,
   > 
   > When you put your image data into the NDArray, can you also try to copy it 
to GPU using `as_in_context` method before passing it to your model ?
   > 
   > 
http://mxnet.incubator.apache.org/test/api/python/ndarray.html#mxnet.ndarray.NDArray.as_in_context
   
   Thank you! It works, But not much.
   Before:
       data = [mx.nd.array(im_arrays), mx.nd.array(im_infos)]
   The shape of im_arrays is [8,3,896,1024]. It take 104ms.
   After:
       data = [mx.nd.array(im_arrays, ctx=mx.gpu(1)), mx.nd.array(im_infos)]
   It take 68ms. I think it's not fast enough. 

----------------------------------------------------------------
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