So many mistakes in cpp inference code
Gwencong opened this issue · comments
Gwencong commented
When I inferred with the same image of culane with python and cpp, python result was correct but cpp result was wrong, then I read the cpp inference code and find there were so many mistakes in the cpp inference code with libtorch,such as:
- image process: python code was normalized with imagenet mean and std, but cpp was not;
- the arange idx in here was inconsistent with python;
- the axis of sum op here after softmax and multiply with arange idx was wrong;
- the decode of xy coordinate was wrong here: it should be
loc
instead ofoutputTensor
,loc
was the correct result butoutputTensor
is just the result of argmax;
Perhaps there are other errors in the cpp code.