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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataLoader gives "Broken pipe" error on Linux platform #46802
Comments
can you please comment what you are trying to archive with this line |
@VitalyFedyunin I am just trying to get the next sample from validation queue. What should be the correct way of doing this then? |
@VitalyFedyunin also this |
I meet same error,but when I run same code in cpu ,the error doesn't appear. |
@yxchng valid_iter = iter(valid_queue)
for ... in ...:
input_search, target_search = next(valid_iter) |
I encountered the same "BrokenPipeError" occasionally when I broke the loop in middle of the iterations. I was using Pytorch 1.6. if hasattr(self, '_pin_memory_thread'):
# Use hasattr in case error happens before we set the attribute.
self._pin_memory_thread_done_event.set()
# Send something to pin_memory_thread in case it is waiting
# so that it can wake up and check `pin_memory_thread_done_event`
self._worker_result_queue.put((None, None))
self._pin_memory_thread.join()
self._worker_result_queue.cancel_join_thread()
self._worker_result_queue.close() # may close too early After debugging the code, I found |
馃悰 Bug
Pytorch's DataLoader gives "Broken pipe" error on Linux platform (not Windows). Using
num_workers=0
suppresses the error but that is not a satisfying solution (more of a workaround) because it will largely reduce the efficiency of the code. If it is not a bug, hopefully a guide on how to correct the following code can be given.To Reproduce
Steps to reproduce the behavior:
Stack trace:
Expected behavior
Runs without any error.
Environment
Please copy and paste the output from our
environment collection script
(or fill out the checklist below manually).
You can get the script and run it with:
cc @ssnl @VitalyFedyunin @ejguan
The text was updated successfully, but these errors were encountered: