Many to many RNN training problem

sayan_chakraborty: <p>I am experimenting with a bag of words model with a vocabulary of 35000 words. So, my input is of the size <strong>torch.Size([2, 1, 35165, 106])</strong> and the label (a.k.a target) is of the size <strong>torch.Size([2, 1, 17, 106])</strong>. I am using a <strong>RNN unit</strong> but facing some errors while calculating the loss using crossentropyloss. I have converted the labels into the specified form required by crossentropyloss by using argmax.</p>
<p>This is the error that is being thrown:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/5/f/5febfd643f2c405ab5ae729508de2e744594ae0e.png" data-download-href="https://discuss.pytorch.org/uploads/default/5febfd643f2c405ab5ae729508de2e744594ae0e" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/5/f/5febfd643f2c405ab5ae729508de2e744594ae0e_2_690x247.png" alt="image" data-base62-sha1="dGyXRuZCT65mRrWHIH6i6p9tz1Y" width="690" height="247" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/5/f/5febfd643f2c405ab5ae729508de2e744594ae0e_2_690x247.png, https://discuss.pytorch.org/uploads/default/optimized/3X/5/f/5febfd643f2c405ab5ae729508de2e744594ae0e_2_1035x370.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/5/f/5febfd643f2c405ab5ae729508de2e744594ae0e_2_1380x494.png 2x" data-dominant-color="3A3A3B"><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">1787×642 72.9 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>

sayan_chakraborty: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/4/a/4ad546a755b45022b11662d08ee7a0c6c0263ff8.png" data-download-href="https://discuss.pytorch.org/uploads/default/4ad546a755b45022b11662d08ee7a0c6c0263ff8" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/4/a/4ad546a755b45022b11662d08ee7a0c6c0263ff8_2_690x288.png" alt="image" data-base62-sha1="aG0h1eTlD9NYlYy8GSUyhEak8DC" width="690" height="288" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/4/a/4ad546a755b45022b11662d08ee7a0c6c0263ff8_2_690x288.png, https://discuss.pytorch.org/uploads/default/optimized/3X/4/a/4ad546a755b45022b11662d08ee7a0c6c0263ff8_2_1035x432.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/4/a/4ad546a755b45022b11662d08ee7a0c6c0263ff8_2_1380x576.png 2x" data-dominant-color="212221"><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">1649×690 65.3 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><br>
This is the model.</p>

sayan_chakraborty: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/b/3/b38afad2889d4b8092dae77d3af74b055ec95e17.png" data-download-href="https://discuss.pytorch.org/uploads/default/b38afad2889d4b8092dae77d3af74b055ec95e17" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/b/3/b38afad2889d4b8092dae77d3af74b055ec95e17_2_690x280.png" alt="image" data-base62-sha1="pCjeg8Dy0iprj9FsXnsaxrq07TF" width="690" height="280" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/b/3/b38afad2889d4b8092dae77d3af74b055ec95e17_2_690x280.png, https://discuss.pytorch.org/uploads/default/optimized/3X/b/3/b38afad2889d4b8092dae77d3af74b055ec95e17_2_1035x420.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/b/3/b38afad2889d4b8092dae77d3af74b055ec95e17_2_1380x560.png 2x" data-dominant-color="242424"><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">1702×692 64 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>