nn.Conv2d expects a dimension for a batch size in the input. So you have to feed your network with a tensor of dimensions (batch_size, nb_channels, height, weight).
You can simply add a fake batch dimension with unsqueeze():
img = torch.Tensor(img).unsqueeze(0)