Skip to content

Commit b1bacfc

Browse files
authored
ci: Fix L0_model_control_stress (#8627)
1 parent 9e26193 commit b1bacfc

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

  • qa/python_models/torchvision/resnet50

qa/python_models/torchvision/resnet50/model.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# Copyright 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# Redistribution and use in source and binary forms, with or without
44
# modification, are permitted provided that the following conditions
@@ -25,6 +25,7 @@
2525
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626

2727
import torch
28+
import torchvision
2829
import triton_python_backend_utils as pb_utils
2930
from torch.utils.dlpack import to_dlpack
3031

@@ -35,14 +36,9 @@ def initialize(self, args):
3536
This function initializes pre-trained ResNet50 model.
3637
"""
3738
self.device = "cuda" if args["model_instance_kind"] == "GPU" else "cpu"
38-
# Avoid the "HTTP Error 403: rate limit exceeded" error
39-
torch.hub._validate_not_a_forked_repo = lambda a, b, c: True
40-
# Our tests currently depend on torchvision=0.14,
41-
# to make sure `torch.hub` loads Resnet50 implementation
42-
# compatible with torchvision=0.14, we need to provide tag
4339
self.model = (
44-
torch.hub.load(
45-
"pytorch/vision:v0.14.1", "resnet50", weights="IMAGENET1K_V2"
40+
torchvision.models.resnet50(
41+
weights=torchvision.models.ResNet50_Weights.DEFAULT
4642
)
4743
.to(self.device)
4844
.eval()

0 commit comments

Comments
 (0)