Fix NATS-Bench and NAS-Bench-201 for removing lib
This commit is contained in:
		| @@ -8,11 +8,8 @@ | ||||
| import os, sys, time, tqdm, 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 config_utils import dict2config, load_config | ||||
| from datasets import get_datasets | ||||
| from xautodl.config_utils import dict2config, load_config | ||||
| from xautodl.datasets import get_datasets | ||||
| from nats_bench import create | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -19,12 +19,9 @@ matplotlib.use("agg") | ||||
| import matplotlib.pyplot as plt | ||||
| import matplotlib.ticker as ticker | ||||
|  | ||||
| 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 dict2config, load_config | ||||
| from xautodl.config_utils import dict2config, load_config | ||||
| from xautodl.log_utils import time_string | ||||
| from nats_bench import create | ||||
| from log_utils import time_string | ||||
|  | ||||
|  | ||||
| def get_valid_test_acc(api, arch, dataset): | ||||
|   | ||||
| @@ -20,13 +20,9 @@ import seaborn as sns | ||||
| matplotlib.use("agg") | ||||
| import matplotlib.pyplot as plt | ||||
| import matplotlib.ticker as ticker | ||||
|  | ||||
| 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 dict2config, load_config | ||||
| from log_utils import time_string | ||||
| from models import get_cell_based_tiny_net | ||||
| from xautodl.config_utils import dict2config, load_config | ||||
| from xautodl.log_utils import time_string | ||||
| from xautodl.models import get_cell_based_tiny_net | ||||
| from nats_bench import create | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -21,12 +21,9 @@ matplotlib.use("agg") | ||||
| import matplotlib.pyplot as plt | ||||
| import matplotlib.ticker as ticker | ||||
|  | ||||
| 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 dict2config, load_config | ||||
| from xautodl.config_utils import dict2config, load_config | ||||
| from xautodl.log_utils import time_string | ||||
| from nats_bench import create | ||||
| from log_utils import time_string | ||||
|  | ||||
|  | ||||
| def fetch_data(root_dir="./output/search", search_space="tss", dataset=None): | ||||
|   | ||||
| @@ -20,12 +20,9 @@ matplotlib.use("agg") | ||||
| import matplotlib.pyplot as plt | ||||
| import matplotlib.ticker as ticker | ||||
|  | ||||
| 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 dict2config, load_config | ||||
| from xautodl.config_utils import dict2config, load_config | ||||
| from xautodl.log_utils import time_string | ||||
| from nats_bench import create | ||||
| from log_utils import time_string | ||||
|  | ||||
|  | ||||
| def get_valid_test_acc(api, arch, dataset): | ||||
|   | ||||
| @@ -20,12 +20,9 @@ matplotlib.use("agg") | ||||
| import matplotlib.pyplot as plt | ||||
| import matplotlib.ticker as ticker | ||||
|  | ||||
| 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 dict2config, load_config | ||||
| from xautodl.config_utils import dict2config, load_config | ||||
| from xautodl.log_utils import time_string | ||||
| from nats_bench import create | ||||
| from log_utils import time_string | ||||
|  | ||||
|  | ||||
| plt.rcParams.update( | ||||
|   | ||||
| @@ -21,12 +21,9 @@ matplotlib.use("agg") | ||||
| import matplotlib.pyplot as plt | ||||
| import matplotlib.ticker as ticker | ||||
|  | ||||
| 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 dict2config, load_config | ||||
| from log_utils import time_string | ||||
| from models import get_cell_based_tiny_net | ||||
| from xautodl.config_utils import dict2config, load_config | ||||
| from xautodl.log_utils import time_string | ||||
| from xautodl.models import get_cell_based_tiny_net | ||||
| from nats_bench import create | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -20,12 +20,9 @@ matplotlib.use("agg") | ||||
| import matplotlib.pyplot as plt | ||||
| import matplotlib.ticker as ticker | ||||
|  | ||||
| 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 dict2config, load_config | ||||
| from xautodl.config_utils import dict2config, load_config | ||||
| from xautodl.log_utils import time_string | ||||
| from nats_bench import create | ||||
| from log_utils import time_string | ||||
|  | ||||
|  | ||||
| def fetch_data(root_dir="./output/search", search_space="tss", dataset=None): | ||||
|   | ||||
| @@ -17,15 +17,16 @@ 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 models import CellStructure, get_cell_based_tiny_net | ||||
| from xautodl.log_utils import AverageMeter, time_string, convert_secs2time | ||||
| from xautodl.config_utils import dict2config | ||||
| 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 xautodl.utils import get_md5_file | ||||
|  | ||||
| from nats_bench import pickle_save, pickle_load, ArchResults, ResultsCount | ||||
| from procedures import bench_pure_evaluate as pure_evaluate, get_nas_bench_loaders | ||||
| from utils import get_md5_file | ||||
|  | ||||
|  | ||||
| NATS_SSS_BASE_NAME = "NATS-sss-v1_0"  # 2020.08.28 | ||||
|   | ||||
| @@ -19,13 +19,10 @@ matplotlib.use("agg") | ||||
| import matplotlib.pyplot as plt | ||||
| import matplotlib.ticker as ticker | ||||
|  | ||||
| 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 dict2config, load_config | ||||
| from xautodl.config_utils import dict2config, load_config | ||||
| from xautodl.log_utils import time_string | ||||
| from xautodl.models import get_cell_based_tiny_net, CellStructure | ||||
| from nats_bench import create | ||||
| from log_utils import time_string | ||||
| from models import get_cell_based_tiny_net, CellStructure | ||||
|  | ||||
|  | ||||
| def test_api(api, sss_or_tss=True): | ||||
|   | ||||
| @@ -19,16 +19,17 @@ 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 load_config, dict2config | ||||
| from datasets import get_datasets | ||||
| from models import CellStructure, get_cell_based_tiny_net, get_search_spaces | ||||
| from xautodl.log_utils import AverageMeter, time_string, convert_secs2time | ||||
| from xautodl.config_utils import load_config, dict2config | ||||
| from xautodl.datasets import get_datasets | ||||
| from xautodl.models import CellStructure, get_cell_based_tiny_net, get_search_spaces | ||||
| from xautodl.procedures import ( | ||||
|     bench_pure_evaluate as pure_evaluate, | ||||
|     get_nas_bench_loaders, | ||||
| ) | ||||
| from xautodl.utils import get_md5_file | ||||
|  | ||||
| from nats_bench import pickle_save, pickle_load, ArchResults, ResultsCount | ||||
| from procedures import bench_pure_evaluate as pure_evaluate, get_nas_bench_loaders | ||||
| from utils import get_md5_file | ||||
| from nas_201_api import NASBench201API | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -19,16 +19,16 @@ 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 load_config, dict2config | ||||
| from datasets import get_datasets | ||||
| from models import CellStructure, get_cell_based_tiny_net, get_search_spaces | ||||
| from xautodl.log_utils import AverageMeter, time_string, convert_secs2time | ||||
| from xautodl.config_utils import load_config, dict2config | ||||
| from xautodl.datasets import get_datasets | ||||
| from xautodl.models import CellStructure, get_cell_based_tiny_net, get_search_spaces | ||||
| from xautodl.procedures import ( | ||||
|     bench_pure_evaluate as pure_evaluate, | ||||
|     get_nas_bench_loaders, | ||||
| ) | ||||
| from xautodl.utils import get_md5_file | ||||
| from nats_bench import pickle_save, pickle_load, ArchResults, ResultsCount | ||||
| from procedures import bench_pure_evaluate as pure_evaluate, get_nas_bench_loaders | ||||
| from utils import get_md5_file | ||||
| from nas_201_api import NASBench201API | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user