I’m not sure, what’s going on, as outputs[0] has 2 dimensions.
Have a look at this small example and try to compare your code to it:
model = models.inception_v3(pretrained=True)
x = torch.randn(2, 3, 299, 299)
target = torch.randint(0, 1000, (2,))
criterion = nn.CrossEntropyLoss()

output = model(x)
loss = criterion(output[0], target)
loss.backward()