I want to use torch.cat funcation,But it can't work

username: fyy
cooked: <p><img src="https://discuss.pytorch.org/uploads/default/original/3X/a/4/a42966efaeba23085d036b646d4181f929111c41.png" alt="image" data-base62-sha1="nqf0xzdzuoItQkJE5309KIcQ4mZ" width="454" height="249"><br>
This is x’ shape<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/f/f/ffba4538f7912b74e601239ce22d7fb102dc52ca.png" data-download-href="https://discuss.pytorch.org/uploads/default/ffba4538f7912b74e601239ce22d7fb102dc52ca" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/f/f/ffba4538f7912b74e601239ce22d7fb102dc52ca.png" alt="image" data-base62-sha1="AugPVbsqf6M5dhKjVIfp4wqBWAO" width="690" height="303" data-dominant-color="414345"><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">739×325 10.2 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 x1’s shape <div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/6/a/6a6c6c19f40533d55a4c3880bf3b584eed5981fa.png" data-download-href="https://discuss.pytorch.org/uploads/default/6a6c6c19f40533d55a4c3880bf3b584eed5981fa" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/6/a/6a6c6c19f40533d55a4c3880bf3b584eed5981fa.png" alt="image" data-base62-sha1="fbsU8MQoSWu56dRoVxi8Fj0mDd8" width="690" height="270" data-dominant-color="404345"><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">797×312 9.23 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>

username: ptrblck
cooked: <p>The tensors with the provided shapes should work fine in <code>torch.cat</code>:</p>
<pre><code class="lang-python">x = torch.randn(1, 128, 32, 160, 160)
x1 = torch.randn(1, 64, 32, 160, 160)
x = torch.cat((x, x1), dim=1)
print(x.shape)
&gt; torch.Size([1, 192, 32, 160, 160])
</code></pre>

username: fyy
cooked: <p>Thanks for your help,At the beginning of the code，I write <strong>form torch import cat</strong>,It can be run in the first few cat operations of the network，But when I debugged to the last cat operation, it stopped working,I don’t know the reason .</p>

username: fyy
cooked: <p>when I run train.py in windows , It get error,<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/6/6/66ba5b12c336c7f9b105140281e87192cdb6423d.png" data-download-href="https://discuss.pytorch.org/uploads/default/66ba5b12c336c7f9b105140281e87192cdb6423d" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/6/6/66ba5b12c336c7f9b105140281e87192cdb6423d_2_690x200.png" alt="image" data-base62-sha1="eELXYuuBXB0IcKUbKoFqXNYmfdH" width="690" height="200" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/6/6/66ba5b12c336c7f9b105140281e87192cdb6423d_2_690x200.png, https://discuss.pytorch.org/uploads/default/optimized/3X/6/6/66ba5b12c336c7f9b105140281e87192cdb6423d_2_1035x300.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/6/6/66ba5b12c336c7f9b105140281e87192cdb6423d_2_1380x400.png 2x" data-dominant-color="2E2E29"><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">1777×517 86.1 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>
when I run train.py in ubuntu, It get error ,<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/a/5/a5e7274f63f182ac3c807b835c7c1d19788d45e9.png" data-download-href="https://discuss.pytorch.org/uploads/default/a5e7274f63f182ac3c807b835c7c1d19788d45e9" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/a/5/a5e7274f63f182ac3c807b835c7c1d19788d45e9.png" alt="image" data-base62-sha1="nFE1F8O73vo0UneFtUjlJDGLiaJ" width="690" height="290" data-dominant-color="111111"><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">1186×500 38.2 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>

username: ptrblck
cooked: <p>These are all different errors.<br>
The out of memory issue is raised, if your GPU doesn’t have enough memory and you would have to reduce e.g. the batch size.</p>
<p>The second error is raised if you are passing an input tensor to the model, which is too small and a layer would create an empty output tensor (a pooling layer in your case).</p>
<p>PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier. <img src="https://discuss.pytorch.org/images/emoji/apple/wink.png?v=9" title=":wink:" class="emoji" alt=":wink:"></p>

username: fyy
cooked: <p>thank you very much ,could you tell me how to solve the second error??</p>

username: ptrblck
cooked: <p>You could pass an input with a larger spatial size (height and width) or alternatively remove some pooling layers or other layers, such as strided convs, which would reduce the spatial size too much.</p>

username: fyy
cooked: <p>Thank you for your kind answer，this is the same code in different os.I don’t know why x6 can be calculated in windows,<img src="https://discuss.pytorch.org/uploads/default/original/3X/3/d/3dd4a6a05a6484f1593beb8e5ae16f7c872089ba.png" alt="image" data-base62-sha1="8OYJ8SnmjUXbWvUSDb1XrhST03U" width="428" height="320"> <div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/a/d/ad72c87b3db8159e406c0a1d448a721d395285af.png" data-download-href="https://discuss.pytorch.org/uploads/default/ad72c87b3db8159e406c0a1d448a721d395285af" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/a/d/ad72c87b3db8159e406c0a1d448a721d395285af.png" alt="image" data-base62-sha1="oKowuGeGLRsKHYxxiMhKfjoo0mX" width="690" height="205" data-dominant-color="404244"><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">1039×310 10.1 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> ,<strong>but in ubuntu ,it can’t caculate x6</strong>.<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/4/6/46bc1447ae495575fe7947aff47c047b05b5b6f1.png" data-download-href="https://discuss.pytorch.org/uploads/default/46bc1447ae495575fe7947aff47c047b05b5b6f1" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/4/6/46bc1447ae495575fe7947aff47c047b05b5b6f1.png" alt="image" data-base62-sha1="a5KnBN74RusyuyfTjZbcZg5OeMp" width="690" height="381" data-dominant-color="0F0F0F"><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">1145×633 43.4 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>

username: ptrblck
cooked: <p>I don’t know how the model is defined, but one often overlooked difference between different OSes is the sorting of file names, so I guess your might be facing the same issue for a later input.<br>
Feel free to post a reproducible code snippet by wrapping it into three backticks, as mentioned before, so that we can take a look.</p>