Closed HugoGranstrom closed 3 years ago
I can't get nll_loss
to run for some reason, it just gives me a SIGSEV: illegal memory access
:/ Anyone have any ideas why?
Here's the docs for reference https://pytorch.org/cppdocs/api/function_namespacetorch_1_1nn_1_1functional_1a184d5fa95f2d4ba36538f3da6b10a7be.html#exhale-function-namespacetorch-1-1nn-1-1functional-1a184d5fa95f2d4ba36538f3da6b10a7be
I can't get
nll_loss
to run for some reason, it just gives me aSIGSEV: illegal memory access
:/ Anyone have any ideas why?Here's the docs for reference https://pytorch.org/cppdocs/api/function_namespacetorch_1_1nn_1_1functional_1a184d5fa95f2d4ba36538f3da6b10a7be.html#exhale-function-namespacetorch-1-1nn-1-1functional-1a184d5fa95f2d4ba36538f3da6b10a7be
I'm not good with C++ and stuff like this but log of 0 can crash it? (It was the case in tensorflow like ~4 years ago if i remember correctly📦 )
@machineko Thank you for your suggestion :) It didn't turn out to be zero that was spooking around, it was the fact that target
had to be of type int
and not float
. I tested the corresponding code in Pytorch and it immidietly yelled that at me. So lesson learned, next time I get a SIGSEV I'll try and see if Pytorch can give me a nice error message
I've taken too long to get this done now... Mnist example works again but I will add some tests for
nn
in the coming days.