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

Switch from multiprocessing to multiprocess #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sessa93
Copy link

@Sessa93 Sessa93 commented Jul 21, 2022

Starting from python 3.8 the library, and tests seems to fail with the following error:

Traceback` (most recent call last):
  File "/Users/andrea/repos/pyirt/tests/test_model_wrapper.py", line 39, in test_2pl_solver
    item_param, user_param = irt(self.data,
  File "/Users/andrea/repos/pyirt/pyirt/_pyirt.py", line 46, in irt
    mod.solve_EM()
  File "/Users/andrea/repos/pyirt/pyirt/solver/model.py", line 102, in solve_EM
    self._exp_step()
  File "/Users/andrea/repos/pyirt/pyirt/solver/model.py", line 157, in _exp_step
    self.__update_theta_distr()
  File "/Users/andrea/repos/pyirt/pyirt/solver/model.py", line 342, in __update_theta_distr
    procs = procs_operator(procs, 3600 * 24, 0.1)
  File "/Users/andrea/repos/pyirt/pyirt/solver/model.py", line 28, in procs_operator
    p.start()
  File "/Users/andrea/.pyenv/versions/3.8.13/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/Users/andrea/.pyenv/versions/3.8.13/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/Users/andrea/.pyenv/versions/3.8.13/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/Users/andrea/.pyenv/versions/3.8.13/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/Users/andrea/.pyenv/versions/3.8.13/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Users/andrea/.pyenv/versions/3.8.13/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/Users/andrea/.pyenv/versions/3.8.13/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'IRT_MMLE_2PL.__update_theta_distr.<locals>.update'

The idea is to switch from multiprocessing to multiprocess which uses dill in place of pickle for object pickling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant