Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Create .lock directory #839

Merged
merged 3 commits into from
Mar 22, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix path
  • Loading branch information
Hakuyume committed Mar 20, 2019
commit 1039b07603aee6cb6b2717f2782b7975a1b04a9a
4 changes: 2 additions & 2 deletions chainercv/datasets/ade20k/ade20k_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

def get_ade20k(root, url):
# To support ChainerMN, the target directory should be locked.
with filelock.FileLock(os.path.join(
download.get_dataset_directory('.lock'), 'ade20k.lock')):
with filelock.FileLock(os.path.join(download.get_dataset_directory(
'pfnet/chainercv/.lock'), 'ade20k.lock')):
data_root = download.get_dataset_directory(root)
if os.path.exists(os.path.join(data_root, 'ADEChallengeData2016')):
return data_root
Expand Down
4 changes: 2 additions & 2 deletions chainercv/datasets/camvid/camvid_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@

def get_camvid():
# To support ChainerMN, the target directory should be locked.
with filelock.FileLock(os.path.join(
download.get_dataset_directory('.lock'), 'camvid.lock')):
with filelock.FileLock(os.path.join(download.get_dataset_directory(
'pfnet/chainercv/.lock'), 'camvid.lock')):
data_root = download.get_dataset_directory(root)
download_file_path = utils.cached_download(url)
if len(glob.glob(os.path.join(data_root, '*'))) != 10:
Expand Down
4 changes: 2 additions & 2 deletions chainercv/datasets/coco/coco_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@

def get_coco(split, img_split, year, mode):
# To support ChainerMN, the target directory should be locked.
with filelock.FileLock(os.path.join(
download.get_dataset_directory('.lock'), 'coco.lock')):
with filelock.FileLock(os.path.join(download.get_dataset_directory(
'pfnet/chainercv/.lock'), 'coco.lock')):
data_dir = download.get_dataset_directory(root)
annos_root = os.path.join(data_dir, 'annotations')
img_root = os.path.join(data_dir, 'images')
Expand Down
8 changes: 4 additions & 4 deletions chainercv/datasets/cub/cub_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

def get_cub():
# To support ChainerMN, the target directory should be locked.
with filelock.FileLock(os.path.join(
download.get_dataset_directory('.lock'), 'cub.lock')):
with filelock.FileLock(os.path.join(download.get_dataset_directory(
'pfnet/chainercv/.lock'), 'cub.lock')):
data_root = download.get_dataset_directory(root)
base_path = os.path.join(data_root, 'CUB_200_2011')
if os.path.exists(base_path):
Expand All @@ -33,8 +33,8 @@ def get_cub():

def get_cub_prob_map():
# To support ChainerMN, the target directory should be locked.
with filelock.FileLock(os.path.join(
download.get_dataset_directory('.lock'), 'cub.lock')):
with filelock.FileLock(os.path.join(download.get_dataset_directory(
'pfnet/chainercv/.lock'), 'cub.lock')):
data_root = download.get_dataset_directory(root)
base_path = os.path.join(data_root, 'segmentations')
if os.path.exists(base_path):
Expand Down
4 changes: 2 additions & 2 deletions chainercv/datasets/online_products/online_products_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

def _get_online_products():
# To support ChainerMN, the target directory should be locked.
with filelock.FileLock(os.path.join(
download.get_dataset_directory('.lock'), 'online_products.lock')):
with filelock.FileLock(os.path.join(download.get_dataset_directory(
'pfnet/chainercv/.lock'), 'online_products.lock')):
data_root = download.get_dataset_directory(root)
base_path = os.path.join(data_root, 'Stanford_Online_Products')
if os.path.exists(base_path):
Expand Down
4 changes: 2 additions & 2 deletions chainercv/datasets/sbd/sbd_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def _generate_voc2012_txt(base_path):

def get_sbd():
# To support ChainerMN, the target directory should be locked.
with filelock.FileLock(os.path.join(
download.get_dataset_directory('.lock'), 'sbd.lock')):
with filelock.FileLock(os.path.join(download.get_dataset_directory(
'pfnet/chainercv/.lock'), 'sbd.lock')):
data_root = download.get_dataset_directory(root)
base_path = os.path.join(data_root, 'benchmark_RELEASE/dataset')

Expand Down
4 changes: 2 additions & 2 deletions chainercv/datasets/voc/voc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def get_voc(year, split):
key = '2007_test'

# To support ChainerMN, the target directory should be locked.
with filelock.FileLock(os.path.join(
download.get_dataset_directory('.lock'), 'voc.lock')):
with filelock.FileLock(os.path.join(download.get_dataset_directory(
'pfnet/chainercv/.lock'), 'voc.lock')):
data_root = download.get_dataset_directory(root)
base_path = os.path.join(data_root, 'VOCdevkit/VOC{}'.format(year))
split_file = os.path.join(
Expand Down