Skip to content

Commit

Permalink
Merge pull request #639 from AznamirWoW/caching_fix
Browse files Browse the repository at this point in the history
Reverted the caching functionality to avoid running out of memory
  • Loading branch information
blaisewf authored Aug 27, 2024
2 parents 509ed68 + 1263d34 commit 9d39f54
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rvc/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def train_and_evaluate(
net_d.train()

# Data caching
if True:
if cache_data_in_gpu:
data_iterator = cache
if cache == []:
for batch_idx, info in enumerate(train_loader):
Expand All @@ -559,7 +559,7 @@ def train_and_evaluate(
wave_lengths,
sid,
) = info
if cache_data_in_gpu == True and torch.cuda.is_available():
if torch.cuda.is_available():
phone = phone.cuda(rank, non_blocking=True)
phone_lengths = phone_lengths.cuda(rank, non_blocking=True)
if pitch_guidance == True:
Expand Down Expand Up @@ -604,6 +604,8 @@ def train_and_evaluate(
)
else:
shuffle(cache)
else:
data_iterator = enumerate(train_loader)

epoch_recorder = EpochRecorder()
with tqdm(total=len(train_loader), leave=False) as pbar:
Expand Down

0 comments on commit 9d39f54

Please sign in to comment.