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

Give better errors for multiprocessing (was: Can't pickle error - attribute lookup failed) #117

Closed
olafthiele opened this issue Jan 20, 2021 · 3 comments · Fixed by #126
Closed
Labels
bug Something isn't working NEXT

Comments

@olafthiele
Copy link

Getting the following error while running DSAlign, maybe it has to do with the multiprocessing, but no time to investigate further. Error happens on Ubuntu 18 with Python 3.6, pip 20 and both ways to start the profiler for a script on command line:

INFO:STDERR: File "/home/ubuntu/alignment/DSAlign/align/align.py", line 534, in main
INFO:STDERR: transcripts = list(progress(pool.imap(stt, samples), desc='Transcribing', total=len(samples)))
INFO:STDERR: File "/home/ubuntu/alignment/DSAlign/align/utils.py", line 73, in log_progress
INFO:STDERR: for global_step, obj in enumerate(it, 1):
INFO:STDERR: File "/usr/lib/python3.6/multiprocessing/pool.py", line 735, in next
INFO:STDERR: raise value
INFO:STDERR: File "/usr/lib/python3.6/multiprocessing/pool.py", line 424, in _handle_tasks
INFO:STDERR: put(task)
INFO:STDERR: File "/usr/lib/python3.6/multiprocessing/connection.py", line 206, in send
INFO:STDERR: self._send_bytes(_ForkingPickler.dumps(obj))
INFO:STDERR: File "/usr/lib/python3.6/multiprocessing/reduction.py", line 51, in dumps
INFO:STDERR: cls(buf, protocol).dump(obj)
INFO:STDERR:_pickle.PicklingError: Can't pickle <function stt at 0x7f61d391ddb8>: attribute lookup stt on main failed

@itamarst
Copy link
Collaborator

Sorry this didn't work. I suspect it's the multiprocessing, since Fil doesn't support it.

So one thing you can try is switching to multiprocessing's ThreadPool temporarily for profiling?

And one thing I should do is print a warning on starting a subprocess, and ... at least not break the software.

@itamarst itamarst added the bug Something isn't working label Jan 20, 2021
@itamarst
Copy link
Collaborator

Long term I want to support multiple processes, but it's a big project.

@itamarst itamarst added the NEXT label Jan 20, 2021
@olafthiele
Copy link
Author

Thanks, I didn't find the leak, but a workaround. Feel free to close if you have it on your roadmap. Great work.

@itamarst itamarst changed the title Can't pickle error - attribute lookup failed Give better errors for multiprocessing (was: Can't pickle error - attribute lookup failed) Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working NEXT
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants