Repository navigation
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. |
|
@WANG-MengJiao |
|
@ThomasDelteil Thank you for your response. Let me to get this straight. Do you mean without Also, from the comments in feature_extract.cpp, |
|
@ThomasDelteil can you please respond to @WANG-MengJiao |
|
@WANG-MengJiao @leleamol I have the same problem, have you solved it? Is there any trick I do? |
Uh oh!
There was an error while loading. Please reload this page.
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:
All reactions