Skip to content

run.cpu_bound "Can't pickle local object" error #2221

Closed Answered by rodja
johancj asked this question in Q&A
Discussion options

You must be logged in to vote

run.cpu_bound needs to execute the function in a separate process. For this it needs to transfer the whole state of the passed function to the process (which is done with pickle). We typically solve this in our own code by creating static methods (or free functions) which get all the data as simple parameters (eg. no class/ui logic).

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@rodja
Comment options

@johancj
Comment options

@zhangguolin333
Comment options

@rodja
Comment options

@zhangguolin333
Comment options

Answer selected by johancj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants