File size: 1,226 Bytes
eafbf97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
36
"""Path utils."""
from os.path import dirname, abspath


curr_filepath = abspath(__file__)
repo_path = dirname(dirname(dirname(curr_filepath)))


def get_data_root_from_hostname():
    import socket

    data_root_lib = {
        "diva": "/ssd/pbagad/datasets/",
        "node": "/var/scratch/pbagad/datasets/",
        "fs4": "/var/scratch/pbagad/datasets/",
        "vggdev21": "/scratch/shared/beegfs/piyush/datasets/",
        "node407": "/var/scratch/pbagad/datasets/",
        "gnodee5": "/scratch/shared/beegfs/piyush/datasets/",
        "gnodeg2": "/scratch/shared/beegfs/piyush/datasets/",
        "gnodec2": "/scratch/shared/beegfs/piyush/datasets/",
        "Piyushs-MacBook-Pro": "/Users/piyush/projects/",
        "gnodec1": "/scratch/shared/beegfs/piyush/datasets/",
        "gnodec5": "/scratch/shared/beegfs/piyush/datasets/",
        "gnodec4": "/scratch/shared/beegfs/piyush/datasets/",
        "gnoded2": "/scratch/shared/beegfs/piyush/datasets/",
    }
    hostname = socket.gethostname()
    hostname = hostname.split(".")[0]
    
    assert hostname in data_root_lib.keys(), \
        "Hostname {} not in data_root_lib".format(hostname)

    data_root = data_root_lib[hostname]
    return data_root