Based on the error message it looks like you are using nn.CrossEntropyLoss as your criterion.
By default, you will get three outputs from googlenet: logits, aux_logits1, and aux_logits2.
If you simply pass all three outputs to your criterion, you’ll get this error.
If you don’t need the aux outputs, just pass the logits to your criterion as:
model = models.googlenet()

x = torch.randn(2, 3, 224, 224)
output = model(x)

criterion = nn.CrossEntropyLoss()
criterion(output.logits, torch.randint(0, 1000, (2,)))