Fix NATS-Bench and NAS-Bench-201 for removing lib

This commit is contained in:
D-X-Y
2021-05-24 11:04:18 +08:00
parent c5788ba19c
commit da2575cc6c
31 changed files with 136 additions and 216 deletions

View File

@@ -8,10 +8,7 @@ import torch
from pathlib import Path
from collections import defaultdict
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
if str(lib_dir) not in sys.path:
sys.path.insert(0, str(lib_dir))
from log_utils import AverageMeter, time_string, convert_secs2time
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
def check_files(save_dir, meta_file, basestr):

View File

@@ -10,16 +10,13 @@ ImageFile.LOAD_TRUNCATED_IMAGES = True
from copy import deepcopy
from pathlib import Path
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
if str(lib_dir) not in sys.path:
sys.path.insert(0, str(lib_dir))
from config_utils import load_config
from procedures import save_checkpoint, copy_checkpoint
from procedures import get_machine_info
from datasets import get_datasets
from log_utils import Logger, AverageMeter, time_string, convert_secs2time
from models import CellStructure, CellArchitectures, get_search_spaces
from functions import evaluate_for_seed
from xautodl.config_utils import load_config
from xautodl.procedures import save_checkpoint, copy_checkpoint
from xautodl.procedures import get_machine_info
from xautodl.datasets import get_datasets
from xautodl.log_utils import Logger, AverageMeter, time_string, convert_secs2time
from xautodl.models import CellStructure, CellArchitectures, get_search_spaces
from xautodl.functions import evaluate_for_seed
def evaluate_all_datasets(

View File

@@ -3,12 +3,9 @@
################################################################################################
# python exps/NAS-Bench-201/show-best.py --api_path $HOME/.torch/NAS-Bench-201-v1_0-e61699.pth #
################################################################################################
import sys, argparse
import argparse
from pathlib import Path
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
if str(lib_dir) not in sys.path:
sys.path.insert(0, str(lib_dir))
from nas_201_api import NASBench201API as API
if __name__ == "__main__":

View File

@@ -8,16 +8,13 @@ from pathlib import Path
from collections import defaultdict, OrderedDict
from typing import Dict, Any, Text, List
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
if str(lib_dir) not in sys.path:
sys.path.insert(0, str(lib_dir))
from log_utils import AverageMeter, time_string, convert_secs2time
from config_utils import dict2config
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
from xautodl.config_utils import dict2config
# NAS-Bench-201 related module or function
from models import CellStructure, get_cell_based_tiny_net
from xautodl.models import CellStructure, get_cell_based_tiny_net
from xautodl.procedures import bench_pure_evaluate as pure_evaluate, get_nas_bench_loaders
from nas_201_api import NASBench201API, ArchResults, ResultsCount
from procedures import bench_pure_evaluate as pure_evaluate, get_nas_bench_loaders
api = NASBench201API(
"{:}/.torch/NAS-Bench-201-v1_0-e61699.pth".format(os.environ["HOME"])

View File

@@ -7,17 +7,14 @@ import torch
from pathlib import Path
from collections import defaultdict
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
if str(lib_dir) not in sys.path:
sys.path.insert(0, str(lib_dir))
from log_utils import AverageMeter, time_string, convert_secs2time
from config_utils import load_config, dict2config
from datasets import get_datasets
from xautodl.log_utils import AverageMeter, time_string, convert_secs2time
from xautodl.config_utils import load_config, dict2config
from xautodl.datasets import get_datasets
# NAS-Bench-201 related module or function
from models import CellStructure, get_cell_based_tiny_net
from xautodl.models import CellStructure, get_cell_based_tiny_net
from xautodl.procedures import bench_pure_evaluate as pure_evaluate
from nas_201_api import ArchResults, ResultsCount
from procedures import bench_pure_evaluate as pure_evaluate
def create_result_count(used_seed, dataset, arch_config, results, dataloader_dict):

View File

@@ -10,11 +10,8 @@ from tqdm import tqdm
import torch
from pathlib import Path
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
if str(lib_dir) not in sys.path:
sys.path.insert(0, str(lib_dir))
from log_utils import time_string
from models import CellStructure
from xautodl.log_utils import time_string
from xautodl.models import CellStructure
from nas_201_api import NASBench201API as API

View File

@@ -17,10 +17,7 @@ from mpl_toolkits.mplot3d import Axes3D
matplotlib.use("agg")
import matplotlib.pyplot as plt
lib_dir = (Path(__file__).parent / ".." / ".." / "lib").resolve()
if str(lib_dir) not in sys.path:
sys.path.insert(0, str(lib_dir))
from log_utils import time_string
from xautodl.log_utils import time_string
from nas_201_api import NASBench201API as API