TypeError: conv2d() received an invalid combination of arguments；I want to modified to custom layer

RonaldYuren: <p>Hi, I want to change a custom-designed layer “Conv”, which is the photo1 below and is implement successfully, into my own layer “ConvPACT” but it come across some problem like:</p>
<p>########<br>
TypeError: conv2d() received an invalid combination of arguments - got (Tensor, Parameter, NoneType, tuple, tuple, tuple, int), but expected one of:</p>
<ul>
<li>(Tensor input, Tensor weight, Tensor bias, tuple of ints stride, tuple of ints padding, tuple of ints dilation, int groups)<br>
didn’t match because some of the arguments have invalid types: (Tensor, Parameter, NoneType, tuple of (NoneType, NoneType), tuple of (int, int), tuple of (int, int), int)</li>
<li>(Tensor input, Tensor weight, Tensor bias, tuple of ints stride, str padding, tuple of ints dilation, int groups)<br>
didn’t match because some of the arguments have invalid types: (Tensor, Parameter, NoneType, tuple of (NoneType, NoneType), tuple of (int, int), tuple of (int, int), int)<br>
############</li>
</ul>
<p>below are the photo Conv and ConvPACT 's code:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/b/d/bdd01081b5f2eb6ad50ece1a2905ff8768f7cda5.png" data-download-href="https://discuss.pytorch.org/uploads/default/bdd01081b5f2eb6ad50ece1a2905ff8768f7cda5" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/b/d/bdd01081b5f2eb6ad50ece1a2905ff8768f7cda5.png" alt="image" data-base62-sha1="r5a17dgAxyKY4kLGItIQXC4nbF3" width="690" height="169" data-dominant-color="444443"><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">1500×369 25.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>
<p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/0/8/0817543d34da9ab486c885aece63bdb572546983.png" data-download-href="https://discuss.pytorch.org/uploads/default/0817543d34da9ab486c885aece63bdb572546983" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/0/8/0817543d34da9ab486c885aece63bdb572546983.png" alt="image" data-base62-sha1="19zNJ31PBOAnpGlyZ0JYkOHWRRV" width="690" height="443" data-dominant-color="414140"><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">1357×873 56.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><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/1/8102d4b54905ffb0df2f872e12d3ed3914721bbb.png" data-download-href="https://discuss.pytorch.org/uploads/default/8102d4b54905ffb0df2f872e12d3ed3914721bbb" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/8/1/8102d4b54905ffb0df2f872e12d3ed3914721bbb.png" alt="image" data-base62-sha1="iphEQB3iEy4o1sixtIVdUINPMDh" width="690" height="111" data-dominant-color="424241"><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">1094×176 10.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>
<p>Please tell me how could I modified, and which line may be wrong, Thx!!<br>
PS:  below are the whole error message:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/6/f/6f35ddc311e5bcb028e088aa45d3b6f2414920d7.png" data-download-href="https://discuss.pytorch.org/uploads/default/6f35ddc311e5bcb028e088aa45d3b6f2414920d7" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/6/f/6f35ddc311e5bcb028e088aa45d3b6f2414920d7.png" alt="image" data-base62-sha1="fROpf41BPKQ2tpYhnsVk8GGHvT1" width="522" height="500" data-dominant-color="302F30"><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">655×627 39.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>

ptrblck: <p>Could you post a minimal and executable code snippet by wrapping it into three backticks ``` instead of screenshots, please?</p>

RonaldYuren: <p>Hi,<br>
I am using the yolov7 ( <a href="https://github.com/WongKinYiu/yolov7/blob/main/models/common.py" class="inline-onebox" rel="noopener nofollow ugc">yolov7/models/common.py at main · WongKinYiu/yolov7 · GitHub</a> ) with my custom dataset , which is containing 1024*960 RGB images , to do object-detection.<br>
I am <strong>trying to change the Conv class in yolov7/models/common.py (Line:99) into my custom ConvPACT</strong><br>
and implementing the " train.py"</p>

RonaldYuren: <aside class="quote no-group" data-username="RonaldYuren" data-post="1" data-topic="203615">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ronaldyuren/48/66030_2.png" class="avatar"> RonaldYuren:</div>
<blockquote>
<p>TypeError: conv2d() received an invalid combination of arguments</p>
</blockquote>
</aside>
<p>Besides the description on the above, I also change the yolov7-tiny.yaml into:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/c/8/c891698e6eb49f3210ccf5556e21d8a34d516fe9.png" data-download-href="https://discuss.pytorch.org/uploads/default/c891698e6eb49f3210ccf5556e21d8a34d516fe9" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/3X/c/8/c891698e6eb49f3210ccf5556e21d8a34d516fe9.png" alt="image" data-base62-sha1="sCj2og6CKresrpNv32VUSOeNPex" width="690" height="257" data-dominant-color="434342"><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">903×337 10 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>Try to isolate the failing call and post a minimal and executable code snippet reproducing the issue.</p>