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

cv2 resize hangs #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

cv2 resize hangs #14

wants to merge 1 commit into from

Conversation

zmurez
Copy link
Contributor

@zmurez zmurez commented Aug 20, 2020

With large images, cv2.resize() is called.

However this hangs the pytorch dataloader due to a threading issue (see https://stackoverflow.com/questions/54013846/pytorch-dataloader-stucked-if-using-opencv-resize-method).

@sarlinpe
Copy link
Member

sarlinpe commented Dec 4, 2020

Sorry for the delay. I can't reproduce the bug; what environment are you using? I'm reluctant to change a global state that might impact other libraries relying on hloc. Would this work instead?

loader = torch.utils.data.DataLoader(
    loader, num_workers=1,
    worker_init_fn=lambda _: cv2.setNumThreads(0))

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

Successfully merging this pull request may close these issues.

2 participants