Fix path errors in TAS due to lib->xautodl
This commit is contained in:
parent
b50ad2a522
commit
b4e8eae63a
@ -9,4 +9,4 @@
|
|||||||
- [2020.10.15] [446262a](https://github.com/D-X-Y/AutoDL-Projects/tree/446262a) Update NATS-BENCH to version 1.0
|
- [2020.10.15] [446262a](https://github.com/D-X-Y/AutoDL-Projects/tree/446262a) Update NATS-BENCH to version 1.0
|
||||||
- [2020.12.20] [dae387a](https://github.com/D-X-Y/AutoDL-Projects/tree/dae387a) Update NATS-BENCH to version 1.1
|
- [2020.12.20] [dae387a](https://github.com/D-X-Y/AutoDL-Projects/tree/dae387a) Update NATS-BENCH to version 1.1
|
||||||
- [2021.05.18] [98fadf8](https://github.com/D-X-Y/AutoDL-Projects/tree/98fadf8) Before moving to `xautodl`
|
- [2021.05.18] [98fadf8](https://github.com/D-X-Y/AutoDL-Projects/tree/98fadf8) Before moving to `xautodl`
|
||||||
- [2021.05.19] [129c9e5](https://github.com/D-X-Y/AutoDL-Projects/tree/129c9e5) `xautodl` is close to ready
|
- [2021.05.19] [b50ad2a](https://github.com/D-X-Y/AutoDL-Projects/tree/b50ad2a) `xautodl` is close to ready
|
||||||
|
@ -10,6 +10,10 @@ from tqdm import tqdm
|
|||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
lib_dir = (Path(__file__).parent / "..").resolve()
|
||||||
|
if str(lib_dir) not in sys.path:
|
||||||
|
sys.path.insert(0, str(lib_dir))
|
||||||
|
|
||||||
from xautodl.procedures import (
|
from xautodl.procedures import (
|
||||||
prepare_seed,
|
prepare_seed,
|
||||||
prepare_logger,
|
prepare_logger,
|
||||||
|
@ -3,21 +3,16 @@
|
|||||||
##############################################################################
|
##############################################################################
|
||||||
# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2020.07 #
|
# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2020.07 #
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# python ./exps/NATS-Bench/main-tss.py --mode meta #
|
# python ./exps/NATS-Bench/show-dataset.py #
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import os, sys, time, torch, random, argparse
|
import os, sys, time, torch, random, argparse
|
||||||
from typing import List, Text, Dict, Any
|
from typing import List, Text, Dict, Any
|
||||||
from PIL import ImageFile
|
from PIL import ImageFile
|
||||||
|
|
||||||
ImageFile.LOAD_TRUNCATED_IMAGES = True
|
ImageFile.LOAD_TRUNCATED_IMAGES = True
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
lib_dir = (Path(__file__).parent / ".." / "lib").resolve()
|
from xautodl.config_utils import dict2config, load_config
|
||||||
if str(lib_dir) not in sys.path:
|
from xautodl.datasets import get_datasets
|
||||||
sys.path.insert(0, str(lib_dir))
|
|
||||||
from config_utils import dict2config, load_config
|
|
||||||
from datasets import get_datasets
|
|
||||||
from nats_bench import create
|
from nats_bench import create
|
||||||
|
|
||||||
|
|
@ -12,16 +12,22 @@ import numpy as np
|
|||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
lib_dir = (Path(__file__).parent / ".." / "lib").resolve()
|
from xautodl.config_utils import (
|
||||||
if str(lib_dir) not in sys.path:
|
load_config,
|
||||||
sys.path.insert(0, str(lib_dir))
|
configure2str,
|
||||||
from config_utils import load_config, configure2str, obtain_search_args as obtain_args
|
obtain_search_args as obtain_args,
|
||||||
from procedures import prepare_seed, prepare_logger, save_checkpoint, copy_checkpoint
|
)
|
||||||
from procedures import get_optim_scheduler, get_procedures
|
from xautodl.procedures import (
|
||||||
from datasets import get_datasets, SearchDataset
|
prepare_seed,
|
||||||
from models import obtain_search_model, obtain_model, change_key
|
prepare_logger,
|
||||||
from utils import get_model_infos
|
save_checkpoint,
|
||||||
from log_utils import AverageMeter, time_string, convert_secs2time
|
copy_checkpoint,
|
||||||
|
)
|
||||||
|
from xautodl.procedures import get_optim_scheduler, get_procedures
|
||||||
|
from xautodl.datasets import get_datasets, SearchDataset
|
||||||
|
from xautodl.models import obtain_search_model, obtain_model, change_key
|
||||||
|
from xautodl.utils import get_model_infos
|
||||||
|
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
|
||||||
|
|
||||||
|
|
||||||
def main(args):
|
def main(args):
|
@ -8,16 +8,18 @@ ImageFile.LOAD_TRUNCATED_IMAGES = True
|
|||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
lib_dir = (Path(__file__).parent / ".." / "lib").resolve()
|
from xautodl.config_utils import load_config, obtain_cls_kd_args as obtain_args
|
||||||
if str(lib_dir) not in sys.path:
|
from xautodl.procedures import (
|
||||||
sys.path.insert(0, str(lib_dir))
|
prepare_seed,
|
||||||
from config_utils import load_config, obtain_cls_kd_args as obtain_args
|
prepare_logger,
|
||||||
from procedures import prepare_seed, prepare_logger, save_checkpoint, copy_checkpoint
|
save_checkpoint,
|
||||||
from procedures import get_optim_scheduler, get_procedures
|
copy_checkpoint,
|
||||||
from datasets import get_datasets
|
)
|
||||||
from models import obtain_model, load_net_from_checkpoint
|
from xautodl.procedures import get_optim_scheduler, get_procedures
|
||||||
from utils import get_model_infos
|
from xautodl.datasets import get_datasets
|
||||||
from log_utils import AverageMeter, time_string, convert_secs2time
|
from xautodl.models import obtain_model, load_net_from_checkpoint
|
||||||
|
from xautodl.utils import get_model_infos
|
||||||
|
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
|
||||||
|
|
||||||
|
|
||||||
def main(args):
|
def main(args):
|
@ -6,20 +6,13 @@ from PIL import ImageFile
|
|||||||
|
|
||||||
ImageFile.LOAD_TRUNCATED_IMAGES = True
|
ImageFile.LOAD_TRUNCATED_IMAGES = True
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
lib_dir = (Path(__file__).parent / ".." / "lib").resolve()
|
from xautodl.config_utils import load_config, dict2config
|
||||||
if str(lib_dir) not in sys.path:
|
from xautodl.procedures import get_procedures, get_optim_scheduler
|
||||||
sys.path.insert(0, str(lib_dir))
|
from xautodl.datasets import get_datasets
|
||||||
from config_utils import load_config, dict2config
|
from xautodl.models import obtain_model
|
||||||
from procedures import get_procedures, get_optim_scheduler
|
from xautodl.utils import get_model_infos
|
||||||
from datasets import get_datasets
|
from xautodl.log_utils import PrintLogger, time_string
|
||||||
from models import obtain_model
|
|
||||||
from utils import get_model_infos
|
|
||||||
from log_utils import PrintLogger, time_string
|
|
||||||
|
|
||||||
|
|
||||||
assert torch.cuda.is_available(), "torch.cuda is not available"
|
|
||||||
|
|
||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
@ -118,4 +111,5 @@ if __name__ == "__main__":
|
|||||||
"--checkpoint", type=str, help="Choose between Cifar10/100 and ImageNet."
|
"--checkpoint", type=str, help="Choose between Cifar10/100 and ImageNet."
|
||||||
)
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
assert torch.cuda.is_available(), "torch.cuda is not available"
|
||||||
main(args)
|
main(args)
|
@ -32,7 +32,7 @@ save_dir=${SAVE_ROOT}/search-depth/${dataset}-${model}-${optim}-Gumbel_${gumbel_
|
|||||||
|
|
||||||
python --version
|
python --version
|
||||||
|
|
||||||
OMP_NUM_THREADS=4 python ./exps/search-shape.py --dataset ${dataset} \
|
OMP_NUM_THREADS=4 python ./exps/TAS/search-shape.py --dataset ${dataset} \
|
||||||
--data_path $TORCH_HOME/cifar.python \
|
--data_path $TORCH_HOME/cifar.python \
|
||||||
--model_config ./configs/archs/CIFAR-${model}.config \
|
--model_config ./configs/archs/CIFAR-${model}.config \
|
||||||
--split_path ./.latent-data/splits/${dataset}-0.5.pth \
|
--split_path ./.latent-data/splits/${dataset}-0.5.pth \
|
||||||
@ -53,7 +53,7 @@ if [ "$rseed" = "-1" ]; then
|
|||||||
else
|
else
|
||||||
# normal training
|
# normal training
|
||||||
xsave_dir=${save_dir}/seed-${rseed}-NMT
|
xsave_dir=${save_dir}/seed-${rseed}-NMT
|
||||||
OMP_NUM_THREADS=4 python ./exps/basic-main.py --dataset ${dataset} \
|
OMP_NUM_THREADS=4 python ./exps/basic/basic-main.py --dataset ${dataset} \
|
||||||
--data_path $TORCH_HOME/cifar.python \
|
--data_path $TORCH_HOME/cifar.python \
|
||||||
--model_config ${save_dir}/seed-${rseed}-last.config \
|
--model_config ${save_dir}/seed-${rseed}-last.config \
|
||||||
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
|
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
|
||||||
@ -64,7 +64,7 @@ else
|
|||||||
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
|
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
|
||||||
# KD training
|
# KD training
|
||||||
xsave_dir=${save_dir}/seed-${rseed}-KDT
|
xsave_dir=${save_dir}/seed-${rseed}-KDT
|
||||||
OMP_NUM_THREADS=4 python ./exps/KD-main.py --dataset ${dataset} \
|
OMP_NUM_THREADS=4 python ./exps/basic/KD-main.py --dataset ${dataset} \
|
||||||
--data_path $TORCH_HOME/cifar.python \
|
--data_path $TORCH_HOME/cifar.python \
|
||||||
--model_config ${save_dir}/seed-${rseed}-last.config \
|
--model_config ${save_dir}/seed-${rseed}-last.config \
|
||||||
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
|
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
|
||||||
|
@ -28,7 +28,7 @@ save_dir=./output/search-shape/${dataset}-${model}-${optim}-Gumbel_${gumbel_min}
|
|||||||
|
|
||||||
python --version
|
python --version
|
||||||
|
|
||||||
OMP_NUM_THREADS=4 python ./exps/search-transformable.py --dataset ${dataset} \
|
OMP_NUM_THREADS=4 python ./exps/TAS/search-transformable.py --dataset ${dataset} \
|
||||||
--data_path $TORCH_HOME/cifar.python \
|
--data_path $TORCH_HOME/cifar.python \
|
||||||
--model_config ./configs/archs/CIFAR-${model}.config \
|
--model_config ./configs/archs/CIFAR-${model}.config \
|
||||||
--split_path ./.latent-data/splits/${dataset}-0.5.pth \
|
--split_path ./.latent-data/splits/${dataset}-0.5.pth \
|
||||||
@ -48,7 +48,7 @@ if [ "$rseed" = "-1" ]; then
|
|||||||
else
|
else
|
||||||
# normal training
|
# normal training
|
||||||
xsave_dir=${save_dir}/seed-${rseed}-NMT
|
xsave_dir=${save_dir}/seed-${rseed}-NMT
|
||||||
OMP_NUM_THREADS=4 python ./exps/basic-main.py --dataset ${dataset} \
|
OMP_NUM_THREADS=4 python ./exps/basic/basic-main.py --dataset ${dataset} \
|
||||||
--data_path $TORCH_HOME/cifar.python \
|
--data_path $TORCH_HOME/cifar.python \
|
||||||
--model_config ${save_dir}/seed-${rseed}-last.config \
|
--model_config ${save_dir}/seed-${rseed}-last.config \
|
||||||
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
|
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
|
||||||
@ -59,7 +59,7 @@ else
|
|||||||
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
|
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
|
||||||
# KD training
|
# KD training
|
||||||
xsave_dir=${save_dir}/seed-${rseed}-KDT
|
xsave_dir=${save_dir}/seed-${rseed}-KDT
|
||||||
OMP_NUM_THREADS=4 python ./exps/KD-main.py --dataset ${dataset} \
|
OMP_NUM_THREADS=4 python ./exps/basic/KD-main.py --dataset ${dataset} \
|
||||||
--data_path $TORCH_HOME/cifar.python \
|
--data_path $TORCH_HOME/cifar.python \
|
||||||
--model_config ${save_dir}/seed-${rseed}-last.config \
|
--model_config ${save_dir}/seed-${rseed}-last.config \
|
||||||
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
|
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
|
||||||
|
@ -32,7 +32,7 @@ save_dir=${SAVE_ROOT}/search-width/${dataset}-${model}-${optim}-Gumbel_${gumbel_
|
|||||||
|
|
||||||
python --version
|
python --version
|
||||||
|
|
||||||
OMP_NUM_THREADS=4 python ./exps/search-shape.py --dataset ${dataset} \
|
OMP_NUM_THREADS=4 python ./exps/TAS/search-shape.py --dataset ${dataset} \
|
||||||
--data_path $TORCH_HOME/cifar.python \
|
--data_path $TORCH_HOME/cifar.python \
|
||||||
--model_config ./configs/archs/CIFAR-${model}.config \
|
--model_config ./configs/archs/CIFAR-${model}.config \
|
||||||
--split_path ./.latent-data/splits/${dataset}-0.5.pth \
|
--split_path ./.latent-data/splits/${dataset}-0.5.pth \
|
||||||
@ -53,7 +53,7 @@ if [ "$rseed" = "-1" ]; then
|
|||||||
else
|
else
|
||||||
# normal training
|
# normal training
|
||||||
xsave_dir=${save_dir}/seed-${rseed}-NMT
|
xsave_dir=${save_dir}/seed-${rseed}-NMT
|
||||||
OMP_NUM_THREADS=4 python ./exps/basic-main.py --dataset ${dataset} \
|
OMP_NUM_THREADS=4 python ./exps/basic/basic-main.py --dataset ${dataset} \
|
||||||
--data_path $TORCH_HOME/cifar.python \
|
--data_path $TORCH_HOME/cifar.python \
|
||||||
--model_config ${save_dir}/seed-${rseed}-last.config \
|
--model_config ${save_dir}/seed-${rseed}-last.config \
|
||||||
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
|
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
|
||||||
@ -64,7 +64,7 @@ else
|
|||||||
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
|
--eval_frequency 1 --print_freq 100 --print_freq_eval 200
|
||||||
# KD training
|
# KD training
|
||||||
xsave_dir=${save_dir}/seed-${rseed}-KDT
|
xsave_dir=${save_dir}/seed-${rseed}-KDT
|
||||||
OMP_NUM_THREADS=4 python ./exps/KD-main.py --dataset ${dataset} \
|
OMP_NUM_THREADS=4 python ./exps/basic/KD-main.py --dataset ${dataset} \
|
||||||
--data_path $TORCH_HOME/cifar.python \
|
--data_path $TORCH_HOME/cifar.python \
|
||||||
--model_config ${save_dir}/seed-${rseed}-last.config \
|
--model_config ${save_dir}/seed-${rseed}-last.config \
|
||||||
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
|
--optim_config ./configs/opts/CIFAR-E300-W5-L1-COS.config \
|
||||||
|
@ -26,7 +26,7 @@ save_dir=./output/basic/${dataset}/${model}-${epoch}-${LR}-${batch}
|
|||||||
|
|
||||||
python --version
|
python --version
|
||||||
|
|
||||||
OMP_NUM_THREADS=4 python ./exps/basic-main.py --dataset ${dataset} \
|
OMP_NUM_THREADS=4 python ./exps/basic/basic-main.py --dataset ${dataset} \
|
||||||
--data_path $TORCH_HOME/cifar.python \
|
--data_path $TORCH_HOME/cifar.python \
|
||||||
--model_config ./configs/archs/CIFAR-${model}.config \
|
--model_config ./configs/archs/CIFAR-${model}.config \
|
||||||
--optim_config ./configs/opts/CIFAR-${epoch}-W5-${LR}-COS.config \
|
--optim_config ./configs/opts/CIFAR-${epoch}-W5-${LR}-COS.config \
|
||||||
|
@ -40,7 +40,7 @@ save_dir=${SAVE_ROOT}/nas-infer/${dataset}-${model}-${batch}
|
|||||||
|
|
||||||
python --version
|
python --version
|
||||||
|
|
||||||
python ./exps/basic-main.py --dataset ${dataset} \
|
python ./exps/basic/basic-main.py --dataset ${dataset} \
|
||||||
--data_path ${xpath} --model_source nas \
|
--data_path ${xpath} --model_source nas \
|
||||||
--model_config ./configs/archs/NAS-${base}-${model}.config \
|
--model_config ./configs/archs/NAS-${base}-${model}.config \
|
||||||
--optim_config ./configs/opts/NAS-${base}.config \
|
--optim_config ./configs/opts/NAS-${base}.config \
|
||||||
|
@ -41,7 +41,7 @@ save_dir=${SAVE_ROOT}/nas-infer/${dataset}-BS${batch}-${save_name}
|
|||||||
|
|
||||||
python --version
|
python --version
|
||||||
|
|
||||||
python ./exps/basic-main.py --dataset ${dataset} \
|
python ./exps/basic/basic-main.py --dataset ${dataset} \
|
||||||
--data_path ${xpath} --model_source autodl-searched \
|
--data_path ${xpath} --model_source autodl-searched \
|
||||||
--model_config ./configs/archs/NAS-${base}-none.config \
|
--model_config ./configs/archs/NAS-${base}-none.config \
|
||||||
--optim_config ./configs/opts/NAS-${base}.config \
|
--optim_config ./configs/opts/NAS-${base}.config \
|
||||||
|
@ -40,7 +40,7 @@ python --version
|
|||||||
|
|
||||||
# normal training
|
# normal training
|
||||||
xsave_dir=${save_dir}-NMT
|
xsave_dir=${save_dir}-NMT
|
||||||
OMP_NUM_THREADS=4 python ./exps/basic-main.py --dataset ${dataset} \
|
OMP_NUM_THREADS=4 python ./exps/basic/basic-main.py --dataset ${dataset} \
|
||||||
--data_path ${xpath} \
|
--data_path ${xpath} \
|
||||||
--model_config ./configs/NeurIPS-2019/${model}.config \
|
--model_config ./configs/NeurIPS-2019/${model}.config \
|
||||||
--optim_config ${opt_config} \
|
--optim_config ${opt_config} \
|
||||||
@ -52,7 +52,7 @@ OMP_NUM_THREADS=4 python ./exps/basic-main.py --dataset ${dataset} \
|
|||||||
|
|
||||||
# KD training
|
# KD training
|
||||||
xsave_dir=${save_dir}-KDT
|
xsave_dir=${save_dir}-KDT
|
||||||
OMP_NUM_THREADS=4 python ./exps/KD-main.py --dataset ${dataset} \
|
OMP_NUM_THREADS=4 python ./exps/basic/KD-main.py --dataset ${dataset} \
|
||||||
--data_path ${xpath} \
|
--data_path ${xpath} \
|
||||||
--model_config ./configs/NeurIPS-2019/${model}.config \
|
--model_config ./configs/NeurIPS-2019/${model}.config \
|
||||||
--optim_config ${opt_config} \
|
--optim_config ${opt_config} \
|
||||||
|
Loading…
Reference in New Issue
Block a user