MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / get_dataset_path

Function get_dataset_path

tensorpack/utils/fs.py:87–106  ·  view source on GitHub ↗

Get the path to some dataset under ``$TENSORPACK_DATASET``. Args: args: strings to be joined to form path. Returns: str: path to the dataset.

(*args)

Source from the content-addressed store, hash-verified

85
86
87def get_dataset_path(*args):
88 """
89 Get the path to some dataset under ``$TENSORPACK_DATASET``.
90
91 Args:
92 args: strings to be joined to form path.
93
94 Returns:
95 str: path to the dataset.
96 """
97 d = os.environ.get('TENSORPACK_DATASET', None)
98 if d is None:
99 d = os.path.join(os.path.expanduser('~'), 'tensorpack_data')
100 if execute_only_once():
101 logger.warn("Env var $TENSORPACK_DATASET not set, using {} for datasets.".format(d))
102 if not os.path.isdir(d):
103 mkdir_p(d)
104 logger.info("Created the directory {}.".format(d))
105 assert os.path.isdir(d), d
106 return os.path.join(d, *args)
107
108
109def normpath(path):

Callers 9

get_PennTreeBankFunction · 0.90
__init__Method · 0.90
get_caffe_pbFunction · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls 5

execute_only_onceFunction · 0.85
mkdir_pFunction · 0.85
joinMethod · 0.80
formatMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected