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

pocket.utils.DetectionAPMeter [Errno24] Too many open files #6

Closed
fredzzhang opened this issue Jan 16, 2020 · 3 comments
Closed

pocket.utils.DetectionAPMeter [Errno24] Too many open files #6

fredzzhang opened this issue Jan 16, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@fredzzhang
Copy link
Owner

Following pocket.utils.AveragePrecisionMeter, DetectionAPMeter uses multiprocessing to evaluate APs of different classes. multiprocessing.Pool.imap is used specifically. There have been issues previously regarding the choice of chunk size. It was resolved by applying the heuristics adopted in multiprocessing.Pool.map. The current issue is a bit bizarre because Errno24 appears when there are a large number of classes (e.g. >300) . Yet AveragePrecisionMeter, with similar mechanism, works perfectly regardless of the number of classes or examples.

@fredzzhang fredzzhang added the bug Something isn't working label Jan 16, 2020
@fredzzhang
Copy link
Owner Author

fredzzhang commented Jan 16, 2020

The distinction of DetectionAPMeter from AveragePrecisionMeter is the number of examples being different across classes. But even when the numbers of samples are forced to be the same, the error still occurs.

@fredzzhang
Copy link
Owner Author

fredzzhang commented Jan 16, 2020

A simple fix for this issue is to increase the number of files allowed to be opened, using the following command (replace $NUM with a number)
ulimit -n $NUM
For a linux machine, the current limits can be accessed using the following commands
ulimit -Sn for currently applied soft limit (1024 by default)
ulimit -Hn for hard limit set by system (4096)
Changing the soft limit to 4096 works for the previous scenario that generated the error. The downside is that this command has to be run every time when starting a new terminal. A workaround this is to write it in .basrhc.

fredzzhang added a commit that referenced this issue Oct 29, 2020
@fredzzhang
Copy link
Owner Author

The problem appears to have been fixed with 94e22cf, which specified the number of subprocesses to spawn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant