-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
raise cannot pickle '_thread.lock' object error when use train_loader #4
Comments
It seems you're encountering an issue with multiprocessing, the error occurs when you're trying to use DataLoader with multiple workers (num_workers > 0), which involves pickling and unpickling data. It can sometimes be influenced by the Python version in use. One thing you can try is to check the Python version, we are using Python 3.9. Secondly, a potential solution is to set the number of workers to 0, on line 166 in TransWorldNG\transworld\transworld_exp.py. This adjustment can disable multiprocessing for data loading. After which you may narrow down the cause of the problem. |
Hi, lovelybirds, |
Hi nudtdyk, I noticed the error on line 218 with batch//num_workers. My apologies for suggesting worker=0. Please try worker = 1 to circumvent the integer division by zero issues. We're in the process of creating a Docker environment with the same configurations. Hope this should help in preventing such issues in the future. |
Hi, lovelybirds, |
Describe the bug
Hi, when I run the
transworld_exp.py
file, the following error occurs:To Reproduce
run python file
TransWorldNG\transworld\transworld_exp.py
Expected behavior
train_loader
should return the sampled current and next timestamp graphs, in Line: 40.Desktop:
Possible solution
I notice
w.start()
appears in the python traceback, so I check the objects that contain in parameterargs
(see the following Python statement), and findself._collate_fn
cannot be pickled.Maybe this error is associated with the class
Node
, which usesqueue.Queue
(thequeue.Queue
hasthread.lock
). I thinkcollections.deque
can be an alternative replacement.For more information, please see TypeError: can't pickle _thread.lock objects and Python Multiprocessing Pool.map Causes Error in __new__.
The text was updated successfully, but these errors were encountered: