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

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:

########
TypeError: conv2d() received an invalid combination of arguments - got (Tensor, Parameter, NoneType, tuple, tuple, tuple, int), but expected one of:

  • (Tensor input, Tensor weight, Tensor bias, tuple of ints stride, tuple of ints padding, tuple of ints dilation, int groups)
    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)
  • (Tensor input, Tensor weight, Tensor bias, tuple of ints stride, str padding, tuple of ints dilation, int groups)
    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)
    ############

below are the photo Conv and ConvPACT 's code:


Please tell me how could I modified, and which line may be wrong, Thx!!
PS: below are the whole error message:

Could you post a minimal and executable code snippet by wrapping it into three backticks ``` instead of screenshots, please?

Hi,
I am using the yolov7 ( yolov7/models/common.py at main · WongKinYiu/yolov7 · GitHub ) with my custom dataset , which is containing 1024*960 RGB images , to do object-detection.
I am trying to change the Conv class in yolov7/models/common.py (Line:99) into my custom ConvPACT
and implementing the " train.py"

Besides the description on the above, I also change the yolov7-tiny.yaml into:

Try to isolate the failing call and post a minimal and executable code snippet reproducing the issue.