-
Notifications
You must be signed in to change notification settings - Fork 639
Description
I followed this article and attempted to import an ONNX model into Tensorrt: https://devblogs.nvidia.com/speed-up-inference-tensorrt/#disqus_thread
And I ran into these errors after I performed make in code-samples/posts/TensorRT-introduction:
`simpleOnnx_1.cpp: In lambda function:
simpleOnnx_1.cpp:86:127: error: ‘exp’ was not declared in this scope
double expSum = accumulate(batchVector, batchVector + batchElements, 0.0, [=](double acc, float value) { return acc + exp(value - maxValue); });
^~~
simpleOnnx_1.cpp:86:127: note: suggested alternative: ‘exit’
double expSum = accumulate(batchVector, batchVector + batchElements, 0.0, [=](double acc, float value) { return acc + exp(value - maxValue); });
^~~
exit
simpleOnnx_1.cpp: In function ‘void softmax(std::vector&, int)’:
simpleOnnx_1.cpp:86:25: error: ‘accumulate’ was not declared in this scope
double expSum = accumulate(batchVector, batchVector + batchElements, 0.0, [=](double acc, float value) { return acc + exp(value - maxValue); });
^~~~~~~~~~
simpleOnnx_1.cpp: In lambda function:
simpleOnnx_1.cpp:88:124: error: ‘exp’ is not a member of ‘std’
transform(batchVector, batchVector + batchElements, batchVector, [=](float input) { return static_cast(std::exp(input - maxValue) / expSum); });
^~~
simpleOnnx_1.cpp: In function ‘int main(int, char**)’:
simpleOnnx_1.cpp:144:23: error: ‘accumulate’ was not declared in this scope
size_t size = accumulate(dims.d, dims.d + dims.nbDims, batchSize, multiplies<size_t>());
^~~~~~~~~~
In file included from /usr/include/c++/7/algorithm:62:0,
from simpleOnnx_1.cpp:31:
/usr/include/c++/7/bits/stl_algo.h: In instantiation of ‘_OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation) [with _IIter = float*; _OIter = float*; _UnaryOperation = softmax(std::vector&, int)::<lambda(float)>]’:
simpleOnnx_1.cpp:88:158: required from here
/usr/include/c++/7/bits/stl_algo.h:4306:12: error: void value not ignored as it ought to be
__result = __unary_op(__first);
<builtin>: recipe for target 'simpleOnnx_1.o' failed
make: *** [simpleOnnx_1.o] Error 1
`
Could you please let me know how this can be fixed?
Thanks!