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

TypeError: can't pickle _thread.RLock objects #56

Open
flappy007 opened this issue Jun 3, 2019 · 6 comments
Open

TypeError: can't pickle _thread.RLock objects #56

flappy007 opened this issue Jun 3, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@flappy007
Copy link

flappy007 commented Jun 3, 2019

Hi,
I tried the object detection example and i get below error:
File "c:\continuum\anaconda3\Lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: can't pickle _thread.RLock objects

Could you please help. I am running it in windows and anaconda virtual environment

@jadielam
Copy link
Collaborator

jadielam commented Jun 3, 2019

@flappy007 Do you get the error when running other examples? Have you modified the object detection example in any way? What version of videoflow are you running? And what version of Python? Also, do you have more lines that you could provide on your error dump?

Will look into it.

@jadielam jadielam added the help wanted Extra attention is needed label Jun 3, 2019
@flappy007
Copy link
Author

Hi @jadielam thanks for your prompt reply. I am using the example object detection.py but i even tried other example but got the same error for each one. Python version: 3.6 anaconda, tensorflow: 1.10.0 opencv: 4.1.0 and the latest version of videoflow pulled from git: 0.2.2. Error below:

fl.run()
File "C:\Continuum\Anaconda3\lib\site-packages\videoflow\core\flow.py", line 86, in run
self._execution_engine.allocate_and_run_tasks(tasks_data)
File "C:\Continuum\Anaconda3\lib\site-packages\videoflow\core\engine.py", line 111, in allocate_and_run_tasks
self._al_create_and_start_processes(tasks_data)
File "C:\Continuum\Anaconda3\lib\site-packages\videoflow\engines\batch.py", line 221, in _al_create_and_start_processes
proc.start()
File "C:\Continuum\Anaconda3\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Continuum\Anaconda3\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Continuum\Anaconda3\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Continuum\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 65, in init
reduction.dump(process_obj, to_child)
File "C:\Continuum\Anaconda3\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: can't pickle _thread.RLock objects

@jadielam
Copy link
Collaborator

jadielam commented Jun 3, 2019

I run a Mac and Python 3.7.2, and I don't get errors on this. First thing I will try to do is create an environment similar to yours with those versions and try to replicate, so that then I can see what's a good fix.

@jadielam jadielam removed the help wanted Extra attention is needed label Jun 4, 2019
@flappy007
Copy link
Author

Hi @jadielam any success on this. I too did run the code in Mac and it did not throw any error. The problem seems to be with windows system and how the process/thread is being pickled.

@jadielam
Copy link
Collaborator

jadielam commented Jun 5, 2019

I have been able to reproduce error in WIndows. Updating ticket to be a bug. I will see what I can do. I am not very experienced in Windows, but I hope that my Python can carry me far there.

@jadielam jadielam added the bug Something isn't working label Jun 5, 2019
@ociule
Copy link

ociule commented Jun 19, 2019

FWIW, the stacktrace looks exactly like https://stackoverflow.com/questions/44144584/typeerror-cant-pickle-thread-lock-objects

So I think the fix suggested over there is worth testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants