Skip to content

Commit a6272ea

Browse files
misc
1 parent 8a80ebb commit a6272ea

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

scripts/create-test-dataset.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from collections import defaultdict
1313
import glob
1414
import json
15+
import shutil
1516

1617
BATCH_SIZE = 128 * 4
1718
trainIndx = 0
@@ -105,10 +106,8 @@ def main(args):
105106
with open(os.path.join(folder, 'stats.json'), 'r') as f:
106107
stats = json.load(f)
107108

108-
# remove test-*.npz files from the test-main folder
109-
for fname in glob.glob(os.path.join(args.output, 'test-*.npz')):
110-
os.remove(fname)
111-
continue
109+
# remove all content from the output folder
110+
shutil.rmtree(args.output, ignore_errors=True)
112111
# recursively find the train file
113112
trainFilename = glob.glob(os.path.join(folder, '**', 'test.npz'), recursive=True)
114113
print('Found test files:', len(trainFilename))

0 commit comments

Comments
 (0)