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

DataLoader errors when I set num_workers>1 #20

Closed
alphabet-lgtm opened this issue Nov 18, 2022 · 8 comments
Closed

DataLoader errors when I set num_workers>1 #20

alphabet-lgtm opened this issue Nov 18, 2022 · 8 comments

Comments

@alphabet-lgtm
Copy link

alphabet-lgtm commented Nov 18, 2022

I have found someone says set num_workers=0 will work,but it's too slow...My system is Ubuntu

Exception ignored in: <function _MultiProcessingDataLoaderIter.del at 0x7f7c408fce60>
Traceback (most recent call last):
File "/home/user/miniconda3/envs/IB/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1510, in del
self._shutdown_workers()
File "/home/user/miniconda3/envs/IB/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1493, in _shutdown_workers
if w.is_alive():
File "/home/user/miniconda3/envs/IB/lib/python3.7/multiprocessing/process.py", line 151, in is_alive
assert self._parent_pid == os.getpid(), 'can only test a child process'
AssertionError: can only test a child process

@alphabet-lgtm
Copy link
Author

Maybe tqdm is used in the code?

@Baijiong-Lin
Copy link
Collaborator

Could you provide more details to reproduce this bug? I set the num_workers here as 2, and it can run normally.

@alphabet-lgtm
Copy link
Author

I used examples of train_office and edit a little. I have changed train_dataloaders to my dataloader but it is still imported by torch.utils.data.DataLoader

@Baijiong-Lin
Copy link
Collaborator

Could you successfully run train_office.py if you set the num_workers here as 2?

@alphabet-lgtm
Copy link
Author

I haven't tried yet, but I will try after downloading the dataset. Will there any difference in using dataloaders of train_office.py?

@Baijiong-Lin
Copy link
Collaborator

Anyway, you need to provide enough details (such as environment, source code, running command, and so on) to help us to reproduce this bug. Otherwise, it is hard to find the problem just according to the error information. Thus, the most effective and efficient way is to test the examples we provided. If it is ok, maybe you have edited some code wrongly such as defining the new Dataloader with the wrong format.

@alphabet-lgtm
Copy link
Author

OK, thank you, I will tell you the result after testing the examples.

@Baijiong-Lin
Copy link
Collaborator

Closed as no further updates.

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