Can some one help me in this

Mridul_kumar: <p>I am trying to make a quantum network that would classify images of the Messidor dataset as DR or No DR. But i am getting this error<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/7/6/768adc126d4eea15d3c195f10e5e4eae3a485617.png" data-download-href="https://discuss.pytorch.org/uploads/default/768adc126d4eea15d3c195f10e5e4eae3a485617" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/7/6/768adc126d4eea15d3c195f10e5e4eae3a485617_2_690x244.png" alt="image" data-base62-sha1="gUFQvGUInA1Yc5osKzsxBMIU9lt" width="690" height="244" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/7/6/768adc126d4eea15d3c195f10e5e4eae3a485617_2_690x244.png, https://discuss.pytorch.org/uploads/default/optimized/3X/7/6/768adc126d4eea15d3c195f10e5e4eae3a485617_2_1035x366.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/7/6/768adc126d4eea15d3c195f10e5e4eae3a485617.png 2x" data-dominant-color="272B30"><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">1373×486 57.7 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>

Mridul_kumar: <p>Here is my code<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/7/2/7277a8c0c0530fabc2a965ed59d698554868cd6b.png" data-download-href="https://discuss.pytorch.org/uploads/default/7277a8c0c0530fabc2a965ed59d698554868cd6b" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/7/2/7277a8c0c0530fabc2a965ed59d698554868cd6b_2_690x351.png" alt="image" data-base62-sha1="gkCNCdLqZiUGUzbHnvIywv8qCgz" width="690" height="351" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/7/2/7277a8c0c0530fabc2a965ed59d698554868cd6b_2_690x351.png, https://discuss.pytorch.org/uploads/default/optimized/3X/7/2/7277a8c0c0530fabc2a965ed59d698554868cd6b_2_1035x526.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/7/2/7277a8c0c0530fabc2a965ed59d698554868cd6b.png 2x" data-dominant-color="F2F2F2"><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">1150×586 58.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></p>

Mridul_kumar: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/3/5/3525382557f5610992c98d7646ff8af16353cef9.png" data-download-href="https://discuss.pytorch.org/uploads/default/3525382557f5610992c98d7646ff8af16353cef9" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/3/5/3525382557f5610992c98d7646ff8af16353cef9_2_690x347.png" alt="image" data-base62-sha1="7A92YlUvs5QHBdWtMFQx5LDDN0t" width="690" height="347" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/3/5/3525382557f5610992c98d7646ff8af16353cef9_2_690x347.png, https://discuss.pytorch.org/uploads/default/optimized/3X/3/5/3525382557f5610992c98d7646ff8af16353cef9_2_1035x520.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/3/5/3525382557f5610992c98d7646ff8af16353cef9.png 2x" data-dominant-color="F3F3F3"><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">1305×658 59.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>

Mridul_kumar: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/e/a/ea2dbfb58db1d1bb4ce00ab3a6b55ecfd9061d29.png" data-download-href="https://discuss.pytorch.org/uploads/default/ea2dbfb58db1d1bb4ce00ab3a6b55ecfd9061d29" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/e/a/ea2dbfb58db1d1bb4ce00ab3a6b55ecfd9061d29_2_690x81.png" alt="image" data-base62-sha1="xpDKa8SZlpl2NYrcIxoApOCIYtP" width="690" height="81" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/e/a/ea2dbfb58db1d1bb4ce00ab3a6b55ecfd9061d29_2_690x81.png, https://discuss.pytorch.org/uploads/default/optimized/3X/e/a/ea2dbfb58db1d1bb4ce00ab3a6b55ecfd9061d29_2_1035x121.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/e/a/ea2dbfb58db1d1bb4ce00ab3a6b55ecfd9061d29.png 2x" data-dominant-color="EEEFEF"><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">1052×124 9.53 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>

ptrblck: <p>The first conv layer of your model (<code>self.conv1</code>) uses a single input channel, while you are providing input image tensors with 3 channels.<br>
Set <code>in_channels=3</code> in <code>self.conv1</code> or transform the input to have a single channel only.</p>
<p>PS: it’s better to post code snippets by wrapping them into three backticks ```, as it makes debugging easier.</p>

Mridul_kumar: <p>i did this <div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/2/3/23e7535ab4e1fae4fb06b4660582733093ab0ca2.png" data-download-href="https://discuss.pytorch.org/uploads/default/23e7535ab4e1fae4fb06b4660582733093ab0ca2" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/2/3/23e7535ab4e1fae4fb06b4660582733093ab0ca2_2_690x360.png" alt="image" data-base62-sha1="57Ck6xXFCVvB4yylA9ZPAs2BBgS" width="690" height="360" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/2/3/23e7535ab4e1fae4fb06b4660582733093ab0ca2_2_690x360.png, https://discuss.pytorch.org/uploads/default/optimized/3X/2/3/23e7535ab4e1fae4fb06b4660582733093ab0ca2_2_1035x540.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/2/3/23e7535ab4e1fae4fb06b4660582733093ab0ca2.png 2x" data-dominant-color="F1F1F1"><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">1079×563 59.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></p>

Mridul_kumar: <p>And then this error was there<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/2/c/2c5fe9146e4d28d6def90a9ccc7b2ab02720022f.png" data-download-href="https://discuss.pytorch.org/uploads/default/2c5fe9146e4d28d6def90a9ccc7b2ab02720022f" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/2/c/2c5fe9146e4d28d6def90a9ccc7b2ab02720022f_2_690x368.png" alt="image" data-base62-sha1="6kyuKlWE7sSphuprNZOmLdNswP5" width="690" height="368" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/2/c/2c5fe9146e4d28d6def90a9ccc7b2ab02720022f_2_690x368.png, https://discuss.pytorch.org/uploads/default/original/3X/2/c/2c5fe9146e4d28d6def90a9ccc7b2ab02720022f.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/2/c/2c5fe9146e4d28d6def90a9ccc7b2ab02720022f.png 2x" data-dominant-color="31353A"><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">1001×534 49 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>

Mridul_kumar: <p>sorry but another error<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/f/4/f4c37bc764456b5125810ff9f67da4f7f568d6b5.png" data-download-href="https://discuss.pytorch.org/uploads/default/f4c37bc764456b5125810ff9f67da4f7f568d6b5" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/f/4/f4c37bc764456b5125810ff9f67da4f7f568d6b5_2_690x277.png" alt="image" data-base62-sha1="yVhk6xbQIAqxr6HbZvRrWFRoicl" width="690" height="277" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/f/4/f4c37bc764456b5125810ff9f67da4f7f568d6b5_2_690x277.png, https://discuss.pytorch.org/uploads/default/optimized/3X/f/4/f4c37bc764456b5125810ff9f67da4f7f568d6b5_2_1035x415.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/f/4/f4c37bc764456b5125810ff9f67da4f7f568d6b5.png 2x" data-dominant-color="2A2F34"><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">1238×497 58.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>

gopi: <p>you should be doing this</p>
<pre><code class="lang-auto">self.conv1 = nn.Conv2d(3, 6, kernel_size=80)
self.conv2 = nn.Conv2d(6, 16, kernel_size=80)
</code></pre>
<p>instead of</p>
<blockquote>
<pre><code class="lang-auto">self.conv1 = nn.Conv2d(1, 6, kernel_size=80, in_channels=3)
self.conv2 = nn.Conv2d(6, 16, kernel_size=80, in_channels=3)
</code></pre>
</blockquote>
<p>This is how nn.Conv2d takes parameters.</p>
<p><code>nn.Conv2d(in_channels=3, out_channels=6, kernel_size=80)</code></p>
<p>in your case you had 1 as input parameter for no of input channels and again had in_channels=3.</p>

Mridul_kumar: <p>i have posted another error please help</p>

ptrblck: <p>Your current input is too small for the model architecture and an intermediate activation would be empty after the pooling layer, so that you would either have to increase the spatial size of the input or change the architecture and remove some pooling ops.</p>