using C++ interface on CPU to extract feature vector, delete NDArray::WaitAll() generate incorrect result #13219
Replies: 7 comments
-
Hi @WANG-MengJiao Thanks for submitting the issue. I have submitted a PR #12930 that demonstrates the usage of C++ API in inference workflows. This might provide some help. |
Beta Was this translation helpful? Give feedback.
-
@mxnet-label-bot add [C++, Question] |
Beta Was this translation helpful? Give feedback.
-
@WANG-MengJiao |
Beta Was this translation helpful? Give feedback.
-
@ThomasDelteil Thank you for your response. Let me to get this straight. Do you mean without Also, from the comments in feature_extract.cpp, |
Beta Was this translation helpful? Give feedback.
-
@ThomasDelteil can you please respond to @WANG-MengJiao |
Beta Was this translation helpful? Give feedback.
-
@WANG-MengJiao @leleamol I have the same problem, have you solved it? Is there any trick I do? |
Beta Was this translation helpful? Give feedback.
-
@WANG-MengJiao Please!!!! |
Beta Was this translation helpful? Give feedback.
-
I am using a c++ api on CPU to extract a 512-dim feature vector from images. The feature vector will be printed out.
I encountered with the problem that with/without
NDArray::WaitAll()
generate totally different outputs. Among the results, withNDArray::WaitAll()
can get correct vector.However, the
NDArray::WaitAll()
is very time consuming. According to the comment in feature_extract.cpp, theNDArray::WaitAll()
is needed only when copy between GPU and main memory. So I am wondering why the removal ofNDArray::WaitAll()
will cause incorrect output when I run the program on CPU. Is there any other tricks I should do?The code I used is as follows:
Beta Was this translation helpful? Give feedback.
All reactions