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
ce6fccbe
"git@developer.sourcefind.cn:modelzoo/resnet50_tensorflow.git" did not exist on "ff5cef9a1b94bd673470a07149f8261db8397cb2"
Commit
ce6fccbe
authored
May 14, 2018
by
Sebastian Brodehl
Browse files
Catch error if directory already exists, and continue script.
parent
28b91429
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
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/preprocess_imagenet_validation_data.py
View file @
ce6fccbe
...
@@ -49,6 +49,7 @@ from __future__ import division
...
@@ -49,6 +49,7 @@ from __future__ import division
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
os
import
errno
import
os.path
import
os.path
import
sys
import
sys
...
@@ -69,7 +70,13 @@ if __name__ == '__main__':
...
@@ -69,7 +70,13 @@ if __name__ == '__main__':
# Make all sub-directories in the validation data dir.
# Make all sub-directories in the validation data dir.
for
label
in
unique_labels
:
for
label
in
unique_labels
:
labeled_data_dir
=
os
.
path
.
join
(
data_dir
,
label
)
labeled_data_dir
=
os
.
path
.
join
(
data_dir
,
label
)
os
.
makedirs
(
labeled_data_dir
)
# 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.
# Move all of the image to the appropriate sub-directory.
for
i
in
range
(
len
(
labels
)):
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