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

A minor issue with the data loader #3

Closed
russellizadi opened this issue Oct 8, 2020 · 4 comments
Closed

A minor issue with the data loader #3

russellizadi opened this issue Oct 8, 2020 · 4 comments

Comments

@russellizadi
Copy link

In the data loader, a list of SoundFile objects is kept in self.files which may cause problems in loading because of having too many files open when the memory is limited. I suggest to keep the file names instead and create the object in the __getitem__ method.

@yoyololicon
Copy link
Owner

yoyololicon commented Oct 8, 2020

Thanks for the suggestion.
As I remember, the SoundFile object only keep a reference to the file, so the memory consumption should be very small.
How many files have you tried to open, in your case? I think it might be some other factors that cause the problem.
If it's not the case I will consider create them in __getitem__.

@russellizadi
Copy link
Author

I tried the LJSpeech and it was fine when I closed the f_obj At the end of the __init__ method. When keeping all the files open, it raises a SystemError Which is related to memory. I’m not confident but that was my understanding after searching for this issue. One way to test this is to use psutil and monitor the memory during the __init__ method.

@yoyololicon
Copy link
Owner

Ok I also encountered the same error. Will fix it asap.

@yoyololicon
Copy link
Owner

5a10ff9 should fix the problem.

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

2 participants