Your input is most likely missing the batch dimension so that [3, 500, 500] would be treated as a temporal signal with [batch_size=3, channels=500, seq_len=500]. unsqueeze the batch dimension and it should work:
image = torch.randn(3, 500, 500)
upsample = torch.nn.Upsample(256)
image = upsample(image)
print(image.shape)
# > torch.Size([3, 500, 256])

image = torch.randn(1, 3, 500, 500)
upsample = torch.nn.Upsample(256)
image = upsample(image)
print(image.shape)
# > torch.Size([1, 3, 256, 256])