Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this follow merlin tts #1

Open
forwiat opened this issue Aug 5, 2021 · 0 comments
Open

this follow merlin tts #1

forwiat opened this issue Aug 5, 2021 · 0 comments

Comments

@forwiat
Copy link
Owner

forwiat commented Aug 5, 2021

I also found the problem that memory leaks when using python list or python dict in torch.utils.data.Dataset, whenever num_workers > 0 or num_workers == 0 (I think num_workers == 0 just memory leaks slowly). I solved it when using numpy.array().

memory leak:

class traindataset(Dataset):
    def __init__(self):
          self.utt2fpath = {'utt1': './t1.wav', 'utt2': './t2.wav' ...}
          self.utts = list(self.utt2fpath.keys())
    def __getitem__(self, item):
          utt = self.utts[item]
          fpath = self.utt2fpath[utt]
          ...

without memory leak:

import numpy as np
class traindataset(Dataset):
    def __init__(self):
          self.utt2fpath = np.array([['utt1', './t1.wav'], ['utt2', './t2.wav'], ...])
    def __getitem__(self, item):
          utt = self.utt2fpath[item][0]
          fpath = self.utt2fpath[item][1]
          ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant