Unsure how to debug model.forward error with no message

The last time I had an error with no message it was because my inputs were incorrect in someway. I’m still actively looking to see if there is an error in my data processing, but there has to be a better way to look for what is causing the error than by brute force.

In case it’s just a fundamental understanding I am having, which is probable, the details are as follows:

The error, is specifically that it runs up until I ask it to use the inputs. It then proceeds to abort the program. I switched to debug and all I could figure out was meaningful was this call stack:

In python I have a model with a forward function whose inputs and outputs are defined is this:

forward(self, phones: torch.Tensor, wide: torch.Tensor, shorts: List[torch.Tensor]) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]

Note that I am passing in a List of tensors because the tensors are variable length and I wasn’t sure how to nicely pass it without adding extensive padding, and without changing the order of the tensors to be sorted by length. As they are indeed ordered. If anyone has input, I would appreciate it.

And in c++ I am trying to feed it a Tensor, Tensor, and a TensorList. These are made from existing c++ float arrays. Well, the TensorList is was converted from a std::vector<at::Tensor> from a std::vector<float*>.

Is this correct? Or are those data types wrong for what I am doing?
I am also not certain what more information would be useful, I apologize if this isn’t much to work with.

Got it to work, there were errors in my input data.

  1. A size of an input was wrong
  2. The datatype of another vector was wrong

I suppose i had an invalid float (because it was supposed to be an int) and it caused a major panic causing it to fail. I still would like it if it threw me ANY error message rather than having to bang my head against a wall. Especially if I’m using the debug version of the library. I get that type checking and error checking can be expensive, but feedback would be nice. Since the only reason I know it crashed was because it stopped running, and vs code gave me a little red blip. Which I assume means, program exited with non-zero value.

I’m not developing on Windows, so don’t know if this is platform-specific, but on Linux I am usually seeing a valid error message with a stacktrace. You could export TORCH_SHOW_CPP_STACKTRACES=1 and check if this would give you more information.