Unsure how to debug model.forward error with no message

digits0801: <p>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.</p>
<p>In case it’s just a fundamental understanding I am having, which is probable, the details are as follows:</p>
<p>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:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/d/a/da8059bdec1c7c21e86d4db59d5283bdc84f3dab.png" data-download-href="https://discuss.pytorch.org/uploads/default/da8059bdec1c7c21e86d4db59d5283bdc84f3dab" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/d/a/da8059bdec1c7c21e86d4db59d5283bdc84f3dab.png" alt="image" data-base62-sha1="vaX4RbuYFKrvwgEbzfHZp2xuZp9" width="690" height="373" data-dominant-color="2C2B2E"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1170×633 20.5 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>In python I have a model with a forward function whose inputs and outputs are defined is this:</p>
<pre data-code-wrap="python"><code class="lang-python">forward(self, phones: torch.Tensor, wide: torch.Tensor, shorts: List[torch.Tensor]) -&gt; Tuple[torch.Tensor, torch.Tensor, torch.Tensor]
</code></pre>
<p>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.</p>
<p>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 <code>std::vector&lt;at::Tensor&gt;</code> from a <code>std::vector&lt;float*&gt;</code>.</p>
<p>Is this correct? Or are those data types wrong for what I am doing?<br>
I am also not certain what more information would be useful, I apologize if this isn’t much to work with.</p>

digits0801: <p>Got it to work, there were errors in my input data.</p>
<ol>
<li>A size of an input was wrong</li>
<li>The datatype of another vector was wrong</li>
</ol>
<p>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.</p>

ptrblck: <p>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 <code>export TORCH_SHOW_CPP_STACKTRACES=1</code> and check if this would give you more information.</p>