diff --git a/tools/im2rec.py b/tools/im2rec.py index d72efc4c9b11..6bfcf6057b5b 100644 --- a/tools/im2rec.py +++ b/tools/im2rec.py @@ -144,6 +144,8 @@ def write_worker(q_out, fname, working_dir): print('time:', cur_time - pre_time, ' count:', count) pre_time = cur_time count += 1 + fout.close() + os.remove(fname) os.rename(fname+'.tmp', fname) def parse_args():