First of all, thank you for your replies ptrblck.
Yes, I checked if your code works and it does not raise new errors doing this:
import math
model = ResNet(torchvision.models.resnet.Bottleneck, [3,8,36,3])
x = torch.randn(2, 3, 448, 448)
out = model(x)

The problem is that my error persists, that is why I think that the error can be located in a different line of the code.
Could the error be in the way the model is defined? Here are some lines of the test.py file in which the model is defined:
# define model
net = model.attention_net(topN=PROPOSAL_NUM)
ckpt = torch.load(test_model)
net.load_state_dict(ckpt, strict=False)
net = net.cuda()
net = DataParallel(net)
creterion = torch.nn.CrossEntropyLoss()

# evaluate on train set
train_loss = 0
train_correct = 0
total = 0
net.eval()

for i, data in enumerate(trainloader):
    with torch.no_grad():
        img, label = data[0].cuda(), data[1]
        batch_size = img.size(0)
        print('The shape of the tensor passed to the model is: ' + str(img.shape))
        _, concat_logits, _, _, _ = net(img)

In that last line, the error is raised.