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 2020/04/27 08:38:35 UTC

[GitHub] [incubator-mxnet] zhongqingyang opened a new issue #18173: C++预测模型时遇到的一些那一解决的问题

zhongqingyang opened a new issue #18173:
URL: https://github.com/apache/incubator-mxnet/issues/18173


   我使用的是MxNetCpp.h的API。
   1.在cpu()下使用多线程预测能够正常运行并返回正确结果,gpu()多线程下时,使用NDrray进行图片的归一化和标准化出现内存泄漏,其他涉及到我自己写的NDArry运算也都造成了内存泄露。
   2.我向通过自己编写逻辑来代替NDArray的操作,但是在图片的转置这边出现了问题,我打印出预处理后的图片数组和使用NDArray的运算结果相比,数字基本一样,但是数字的位置变了,代码在下方。
   3.gpu下家在一个模型使用了1689M的显存,计算一个模型时显存到了3072M,加载两个模型并计算显存稳定在4234M计算第三个模型时out of memory程序退出,我在使用C API测试时发现计算三个模型也没有超过2g显存。
   4.使用C API预测模型时,得到的置信度时10多,坐标大部分都是0


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [incubator-mxnet] zhongqingyang commented on issue #18173: C++预测模型时遇到的一些那一解决的问题

Posted by GitBox <gi...@apache.org>.
zhongqingyang commented on issue #18173:
URL: https://github.com/apache/incubator-mxnet/issues/18173#issuecomment-620014800






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [incubator-mxnet] zhongqingyang removed a comment on issue #18173: C++预测模型时遇到的一些那一解决的问题

Posted by GitBox <gi...@apache.org>.
zhongqingyang removed a comment on issue #18173:
URL: https://github.com/apache/incubator-mxnet/issues/18173#issuecomment-620014835


   我现在解决了预处理图片部分,模型已经可以正确的识别目标。但是我想知道NDArray在多线程下是否安全。还有C++API为什么会占用那么多显存。 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [incubator-mxnet] lilongyue commented on issue #18173: C++预测模型时遇到的一些那一解决的问题

Posted by GitBox <gi...@apache.org>.
lilongyue commented on issue #18173:
URL: https://github.com/apache/incubator-mxnet/issues/18173#issuecomment-620009249


   @zhongqingyang i just you using python if you are not familiar with c++.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [incubator-mxnet] zhongqingyang commented on issue #18173: C++预测模型时遇到的一些那一解决的问题

Posted by GitBox <gi...@apache.org>.
zhongqingyang commented on issue #18173:
URL: https://github.com/apache/incubator-mxnet/issues/18173#issuecomment-620351252


   > NDArray是线程安全的。如果您真的很在乎内存,我建议您使用符号而不是NDArray。
   > 符号使用内存优化。
   
   非常感谢您的回复,那么使用C++预测一个模型使用3g的显存是否是正常的呢


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [incubator-mxnet] lilongyue commented on issue #18173: C++预测模型时遇到的一些那一解决的问题

Posted by GitBox <gi...@apache.org>.
lilongyue commented on issue #18173:
URL: https://github.com/apache/incubator-mxnet/issues/18173#issuecomment-620349988


   NDArray is thread safe . If you really care about the memory i suggest using symbols instead of NDArray.
   Symbols use memory optimizations . 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [incubator-mxnet] zhongqingyang closed issue #18173: C++预测模型时遇到的一些那一解决的问题

Posted by GitBox <gi...@apache.org>.
zhongqingyang closed issue #18173:
URL: https://github.com/apache/incubator-mxnet/issues/18173


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org