-
Notifications
You must be signed in to change notification settings - Fork 9
/
config.py
35 lines (32 loc) · 1.12 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""Configuration file for defining paths to data."""
import os
def make_if_not_exist(p):
if not os.path.exists(p):
os.makedirs(p)
hostname = os.uname()[1] # type: str
# Update your paths here.
CHECKPOINT_ROOT = './checkpoint'
if int(hostname.split('-')[-1]) >= 8:
data_root = '/localscratch2/jyhong/'
elif hostname.startswith('illidan'):
data_root = '/media/Research/jyhong/data'
else:
data_root = './data'
make_if_not_exist(data_root)
make_if_not_exist(CHECKPOINT_ROOT)
if hostname.startswith('illidan') and int(hostname.split('-')[-1]) < 8:
# personal config
home_path = os.path.expanduser('~/')
DATA_PATHS = {
"Digits": home_path + "projects/FedBN/data",
"DomainNet": data_root + "/DomainNet",
"DomainNetPathList": home_path + "projects/FedBN/data/", # store the path list file from FedBN
"Cifar10": data_root,
}
else:
DATA_PATHS = {
"Digits": data_root + "/Digits",
"DomainNet": data_root + "/DomainNet",
"DomainNetPathList": data_root + "/DomainNet/domainnet10/", # store the path list file from FedBN
"Cifar10": data_root,
}