Skip to content

Commit 3d85a2c

Browse files
authored
Adding repo tag to torch.hub.load to fix compatibility issues (triton-inference-server#224)
* Adding repo tag to torch.hub.load to fix compatibility issues * Added comments to clarify tag in torch.hub.load
1 parent 076e2f7 commit 3d85a2c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/instance_kind/model.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ def initialize(self, args):
4545
the default device of the framework.
4646
"""
4747
self.device = 'cuda' if args["model_instance_kind"] == "GPU" else 'cpu'
48-
self.model = torch.hub.load("pytorch/vision",
48+
# This example is configured to work with torch=1.13
49+
# and torchvision=0.14. Thus, we need to provide a proper tag `0.14.1`
50+
# to make sure loaded Resnet50 is compatible with
51+
# installed `torchvision`.
52+
# Refer to README for installation instructions.
53+
self.model = torch.hub.load("pytorch/vision:v0.14.1",
4954
"resnet50",
5055
weights="IMAGENET1K_V2",
5156
skip_validation=True)\

0 commit comments

Comments
 (0)