match pytorch 1.6 googlenet pretrained model (#6201) (#6212)
authorwjliu <wjliu1998@gmail.com>
Wed, 5 Aug 2020 20:02:36 +0000 (04:02 +0800)
committerGitHub <noreply@github.com>
Wed, 5 Aug 2020 20:02:36 +0000 (05:02 +0900)
tests/python/frontend/pytorch/test_forward.py

index ab9cca1..e370cd5 100644 (file)
@@ -68,7 +68,11 @@ def load_torchvision(model_name):
         for channel in range(3):
             input_data[:, channel] -= mean[channel]
             input_data[:, channel] /= std[channel]
-        model = getattr(torchvision.models, model_name)(pretrained=True)
+
+        if model_name.startswith("googlenet"):
+            model = getattr(torchvision.models, model_name)(pretrained=True, aux_logits=True)
+        else:
+            model = getattr(torchvision.models, model_name)(pretrained=True)
         model = model.float().eval()
         return model, [input_data]