From 9b2c25d3c927b7533e5d7d9665b67962e4c6934b Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Thu, 17 Mar 2022 20:10:42 +0800 Subject: Move some utils to libs directory --- supervised/baseline.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'supervised/baseline.py') diff --git a/supervised/baseline.py b/supervised/baseline.py index 221b90d..15bb716 100644 --- a/supervised/baseline.py +++ b/supervised/baseline.py @@ -1,3 +1,9 @@ +import sys +from pathlib import Path + +path = str(Path(Path(__file__).parent.absolute()).parent.absolute()) +sys.path.insert(0, path) + import argparse import os import random @@ -11,11 +17,11 @@ from torch.utils.tensorboard import SummaryWriter from torchvision.datasets import CIFAR10, ImageNet from torchvision.transforms import transforms, InterpolationMode -from datautils import color_distortion, Clip, RandomGaussianBlur +from libs.datautils import color_distortion, Clip, RandomGaussianBlur +from libs.optimizers import LARS +from libs.schedulers import LinearWarmupAndCosineAnneal, LinearLR +from libs.utils import training_log, setup_logging, EPOCH_LOGGER, BATCH_LOGGER from models import CIFARResNet50, ImageNetResNet50 -from optimizers import LARS -from schedulers import LinearWarmupAndCosineAnneal, LinearLR -from utils import training_log, setup_logging, EPOCH_LOGGER, BATCH_LOGGER def build_parser(): -- cgit v1.2.3