examples icon indicating copy to clipboard operation
examples copied to clipboard

examples/cpp/custom-dataset/ error

Open Willtl opened this issue 3 years ago • 1 comments

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?

Willtl avatar Apr 12 '21 07:04 Willtl

SAME ERROR. nobody can solve this problem!

peterkim333 avatar Jul 06 '22 03:07 peterkim333

I had the same error. Replacing push_back(Functional(torch::log_softmax, 1)); by push_back(torch::nn::LogSoftmax(1)); might help you.

AliKaf avatar Mar 07 '23 12:03 AliKaf

fixed in https://github.com/pytorch/examples/pull/1214 via push_back(Functional( [](torch::Tensor input) { return torch::log_softmax(input, 1); }))

lancerts avatar Jan 15 '24 04:01 lancerts