Skip to content

Pulp RecursionError: maximum recursion depth exceeded while calling a Python object #357

Answered by pchtsp
ruksarsultana asked this question in Q&A
Discussion options

You must be logged in to vote

Using the multiprocessing package usually causes problems in pulp. There are issues with how the variables are stored and referenced inside the constraints, I think. Because the references to the pulp objects created inside each worker in the pool are not correctly handled afterwards.

If you want to improve the time it takes to build the model, you could share the code and we could help you make it more efficient.
For example, here there is some advice: https://stackoverflow.com/a/64497199/6508131

Note that if i use your first file, it does solve:

import pulp
file = 'model_pulp/model_pulp.json'
variables, model = pulp.LpProblem.from_json(file)
model.solve(pulp.PULP_CBC_CMD())

If you real…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@ruksarsultana
Comment options

@tle4336
Comment options

Answer selected by pchtsp
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants