Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
1886043f
Unverified
Commit
1886043f
authored
May 29, 2018
by
Jon Shlens
Committed by
GitHub
May 29, 2018
Browse files
Merge pull request #4389 from sbrodehl/dev-catcherror
Catch errors during mkdirs, prevent duplicated download
parents
d57fdb38
bbf46694
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
research/inception/inception/data/download_imagenet.sh
research/inception/inception/data/download_imagenet.sh
+1
-2
research/inception/inception/data/preprocess_imagenet_validation_data.py
...ion/inception/data/preprocess_imagenet_validation_data.py
+8
-1
No files found.
research/inception/inception/data/download_imagenet.sh
View file @
1886043f
...
...
@@ -59,9 +59,8 @@ wget "${BOUNDING_BOX_ANNOTATIONS}" -O "${BBOX_TAR_BALL}" || BASE_URL_CHANGE=1
if
[
$BASE_URL_CHANGE
]
;
then
BASE_URL
=
"http://www.image-net.org/challenges/LSVRC/2012/nnoupb"
BOUNDING_BOX_ANNOTATIONS
=
"
${
BASE_URL
}
/ILSVRC2012_bbox_train_v2.tar.gz"
BBOX_TAR_BALL
=
"
${
BBOX_DIR
}
/annotations.tar.gz
"
wget
"
${
BOUNDING_BOX_ANNOTATIONS
}
"
-O
"
${
BBOX_TAR_BALL
}
"
fi
wget
"
${
BOUNDING_BOX_ANNOTATIONS
}
"
-O
"
${
BBOX_TAR_BALL
}
"
echo
"Uncompressing bounding box annotations ..."
tar
xzf
"
${
BBOX_TAR_BALL
}
"
-C
"
${
BBOX_DIR
}
"
...
...
research/inception/inception/data/preprocess_imagenet_validation_data.py
View file @
1886043f
...
...
@@ -49,6 +49,7 @@ from __future__ import division
from
__future__
import
print_function
import
os
import
errno
import
os.path
import
sys
...
...
@@ -69,7 +70,13 @@ if __name__ == '__main__':
# Make all sub-directories in the validation data dir.
for
label
in
unique_labels
:
labeled_data_dir
=
os
.
path
.
join
(
data_dir
,
label
)
# Catch error if sub-directory exists
try
:
os
.
makedirs
(
labeled_data_dir
)
except
OSError
as
e
:
# Raise all errors but 'EEXIST'
if
e
.
errno
!=
errno
.
EEXIST
:
raise
# Move all of the image to the appropriate sub-directory.
for
i
in
range
(
len
(
labels
)):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment