Skip to content

Commit

Permalink
Fix: Bug of repeatedly rewriting tfrecords when validation_split = None.
Browse files Browse the repository at this point in the history
  • Loading branch information
RukuangHuang committed Oct 3, 2024
1 parent 089c7ae commit 05d913b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions osl_dynamics/data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1569,11 +1569,11 @@ def _check_rewrite():
v=len(str(self.n_sessions - 1)),
)
tfrecord_filenames.append(filepath)
if (
rewrite
or not os.path.exists(filepath.format(val=0))
or not os.path.exists(filepath.format(val=1))
):

rewrite_ = rewrite or not os.path.exists(filepath.format(val=0))
if validation_split is not None:
rewrite_ = rewrite_ or not os.path.exists(filepath.format(val=1))
if rewrite_:
tfrecords_to_save.append((i, filepath))

# Function for saving a single TFRecord
Expand Down

0 comments on commit 05d913b

Please sign in to comment.