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

Batch generator hangs with multithread #130

Open
23pointsNorth opened this issue May 1, 2018 · 3 comments
Open

Batch generator hangs with multithread #130

23pointsNorth opened this issue May 1, 2018 · 3 comments

Comments

@23pointsNorth
Copy link

When using alongside the keras ImageDataGenerator with multithreading=True, the process hangs on recv(). Switching the number of workers to 0 (i.e. no multithread) works as expected.

Versions:
imgaug: 0.2.5 (from master 13May18)
python: 3.5
keras: 2.1.3

I saw the last merged PR #126 tacking in the same direction, and have confirmed that the installed version has it, but problem persists.

@aleju
Copy link
Owner

aleju commented May 15, 2018

Do you maybe have a minimal working example? It's fairly hard to test for these rare cases, even more so when a different library is added to the mix.

@mmisono
Copy link

mmisono commented May 28, 2018

I encountered the similar problem (Python 3.6, imgaug 0.2.5, Ubuntu 16.04).
After some investigation, I found that cv2.resize() called in the imgaug.augumenters.Scale() hangs.
It seems OpenCV has some multithreading issue.

In my environment, calling cv2.setNumThreads(0) fixes the problem (though in this case obviously OpenCV use only one thread..)

Possibly related thread: opencv/opencv#5150

@mmisono
Copy link

mmisono commented May 29, 2018

related: pytorch/pytorch#1355

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

3 participants