examples
examples copied to clipboard
examples/cpp/custom-dataset/ error
I'm trying to follow the cpp custom-dataset example, however, I'm getting the folloing error:
error: no matching function for call to ‘torch::nn::Functional::Functional(<unresolved overloaded function type>, int, const c10::nullopt_t&)’
Is this example working with the latest C++ Pytorch library?
SAME ERROR. nobody can solve this problem!
I had the same error. Replacing
push_back(Functional(torch::log_softmax, 1));
by
push_back(torch::nn::LogSoftmax(1));
might help you.
fixed in https://github.com/pytorch/examples/pull/1214 via push_back(Functional( [](torch::Tensor input) { return torch::log_softmax(input, 1); }))