Skip to content

Commit 41ca582

Browse files
committed
[GPUNet/TorchHub] Hiding GPUNet dependencies
1 parent 7e812a0 commit 41ca582

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

PyTorch/Classification/GPUNet/configs/gpunet_torchhub.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414

1515
import os
1616
import torch
17-
from ..models.gpunet_builder import GPUNet_Builder
18-
from .model_hub import get_configs, MODEL_ZOO_NAME2TYPE_B1
19-
from timm.models.helpers import load_checkpoint
2017

2118
def nvidia_gpunet(pretrained=True, **kwargs):
2219
"""Constructs a gpunet model (nn.module with additional infer(input) method).
@@ -27,6 +24,11 @@ def nvidia_gpunet(pretrained=True, **kwargs):
2724
model_math (str, 'fp32'): returns a model in given precision ('fp32' or 'fp16'). Precision fp32 only gpunets
2825
model_type (str, 'GPUNet-0'): loads selected model type GPUNet-1.... or GPUNet-P1 or DPUNet-D3. Defaults to GPUNet-0
2926
"""
27+
28+
from ..models.gpunet_builder import GPUNet_Builder
29+
from .model_hub import get_configs, MODEL_ZOO_NAME2TYPE_B1
30+
from timm.models.helpers import load_checkpoint
31+
3032
modelType = kwargs.get('model_type', 'GPUNet-0')
3133
print("model_type=", modelType)
3234

@@ -63,4 +65,4 @@ def nvidia_gpunet(pretrained=True, **kwargs):
6365

6466
model = model.to("cuda", modelMath)
6567

66-
return model
68+
return model

0 commit comments

Comments
 (0)