File tree Expand file tree Collapse file tree
qa/python_models/torchvision/resnet50 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
2525# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626
2727import torch
28+ import torchvision
2829import triton_python_backend_utils as pb_utils
2930from 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 ()
You can’t perform that action at this time.
0 commit comments