We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28b9142 commit ce6fccbCopy full SHA for ce6fccb
research/inception/inception/data/preprocess_imagenet_validation_data.py
@@ -49,6 +49,7 @@
49
from __future__ import print_function
50
51
import os
52
+import errno
53
import os.path
54
import sys
55
@@ -69,7 +70,13 @@
69
70
# Make all sub-directories in the validation data dir.
71
for label in unique_labels:
72
labeled_data_dir = os.path.join(data_dir, label)
- os.makedirs(labeled_data_dir)
73
+ # Catch error if sub-directory exists
74
+ try:
75
+ os.makedirs(labeled_data_dir)
76
+ except OSError as e:
77
+ # Raise all errors but 'EEXIST'
78
+ if e.errno != errno.EEXIST:
79
+ raise
80
81
# Move all of the image to the appropriate sub-directory.
82
for i in range(len(labels)):
0 commit comments