From 871f4c1b0c1a54017298bce526136c0a9ee86237 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Wed, 19 Jun 2019 16:08:58 -0700 Subject: [PATCH] Change some absolute imports to relative --- data/__init__.py | 12 ++++++------ loss/__init__.py | 2 +- models/__init__.py | 6 +++--- optim/__init__.py | 6 +++--- scheduler/__init__.py | 10 +++++----- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/data/__init__.py b/data/__init__.py index 9c1f1f57..94997658 100644 --- a/data/__init__.py +++ b/data/__init__.py @@ -1,6 +1,6 @@ -from data.constants import * -from data.config import resolve_data_config -from data.dataset import Dataset -from data.transforms import * -from data.loader import create_loader -from data.mixup import mixup_target, FastCollateMixup +from .constants import * +from .config import resolve_data_config +from .dataset import Dataset +from .transforms import * +from .loader import create_loader +from .mixup import mixup_target, FastCollateMixup diff --git a/loss/__init__.py b/loss/__init__.py index 43399e76..f436ccc7 100644 --- a/loss/__init__.py +++ b/loss/__init__.py @@ -1 +1 @@ -from loss.cross_entropy import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy \ No newline at end of file +from .cross_entropy import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy diff --git a/models/__init__.py b/models/__init__.py index 2cd97ca6..f451a270 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -1,4 +1,4 @@ -from models.model_factory import create_model -from models.helpers import load_checkpoint, resume_checkpoint -from models.test_time_pool import TestTimePoolHead, apply_test_time_pool +from .model_factory import create_model +from .helpers import load_checkpoint, resume_checkpoint +from .test_time_pool import TestTimePoolHead, apply_test_time_pool diff --git a/optim/__init__.py b/optim/__init__.py index c418c58a..fe97041d 100644 --- a/optim/__init__.py +++ b/optim/__init__.py @@ -1,3 +1,3 @@ -from optim.nadam import Nadam -from optim.rmsprop_tf import RMSpropTF -from optim.optim_factory import create_optimizer +from .nadam import Nadam +from .rmsprop_tf import RMSpropTF +from .optim_factory import create_optimizer diff --git a/scheduler/__init__.py b/scheduler/__init__.py index 4d84a052..6a778982 100644 --- a/scheduler/__init__.py +++ b/scheduler/__init__.py @@ -1,5 +1,5 @@ -from scheduler.cosine_lr import CosineLRScheduler -from scheduler.plateau_lr import PlateauLRScheduler -from scheduler.step_lr import StepLRScheduler -from scheduler.tanh_lr import TanhLRScheduler -from scheduler.scheduler_factory import create_scheduler \ No newline at end of file +from .cosine_lr import CosineLRScheduler +from .plateau_lr import PlateauLRScheduler +from .step_lr import StepLRScheduler +from .tanh_lr import TanhLRScheduler +from .scheduler_factory import create_scheduler