Hi everyone. I’m trying to implement the code for *DETR* from the paper *End-to-End Object Detection with Transformers*. I need to use *resnet50*.

The first part of the code looks like this:

```
class DETR(nn.Module):
def __init__(self, num_classes, hidden_dim, nheads, num_encoder_layers, num_decoder_layers):
super().__init__()
self.backbone = resnet50(weights=ResNet50_Weights.DEFAULT)
del self.backbone.avgpool
del self.backbone.fc
def forward(self, inputs):
x = self.backbone([input])
return x
```

I try to test the model with

```
detr = DETR(num_classes=91, hidden_dim=256, nheads=8, num_encoder_layers=6, num_decoder_layers=6)
inputs = torch.randn(2, 3, 256, 256)
print(detr(inputs))
```

I simply fed an input `torch.randn(2, 3, 256, 256)`

to `resnet50`

just like the code in the paper. However I encounter with the following error:

```
TypeError: conv2d() received an invalid combination of arguments - got (list, 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: (!list of [method]!, !Parameter!, !NoneType!, !tuple of (int, int)!, !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: (!list of [method]!, !Parameter!, !NoneType!, !tuple of (int, int)!, !tuple of (int, int)!, !tuple of (int, int)!, int)
```

I use

```
torch==2.1.0+cu118
torchvision==0.16.0+cu118
```

I just couldn’t solve it.