Skip to content

Error initializing DefaultRoutingSearchParameters: default '0.5' for field operations_research.sat.SatParameters.clause_cleanup_ratio of type 1 #4427

Open
@Jrgsto

Description

What version of OR-Tools and what language are you using?
Version: 9.11.4210
Language: Python

Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
Routing Solver, CP-SAT,

What operating system (Linux, Windows, ...) and version?
MacOs (but all happening in a docker container with conjunction with django)

What did you do?
It's not easy to reproduce since it only happened for me in certain conditions:

  • Dockerized container with python 3.11
  • Using Django (5.0.8) plus protobuf (5.26.1) and ortools
    More detailed epxlanation
    I am able to successfully build the container and can get into it. If I run plain python and do the following it all works fine
    python -c "from ortools.constraint_solver import pywrapcp; search_parameters = pywrapcp.DefaultRoutingSearchParameters(); print(search_parameters)"

However if I have run it within the code itself or within the Djangp shell (python manage.py shell) then I get this error
Error initializing DefaultRoutingSearchParameters: Couldn't build proto file into descriptor pool: Invalid default '0.5' for field operations_research.sat.SatParameters.clause_cleanup_ratio of type 1

Here is a print statemant

Python version: 3.11.10 (main, Oct 19 2024, 18:56:55) [GCC 12.2.0]
**pywrapcp:** 
<module 'ortools.constraint_solver.pywrapcp' from '/usr/local/lib/python3.11/site-packages/ortools/constraint_solver/pywrapcp.py'>
**Protobuf:** 
<module 'google.protobuf' from '/usr/local/lib/python3.11/site-packages/google/protobuf/__init__.py'>
**Dir in pywrapcp:**
['Assignment', 'AssignmentElement', 'BOOL_FALSE', 'BOOL_TRUE', 'BOOL_UNSPECIFIED', 'BaseLns', 'BaseObject', 'BooleanVar', 'BoundCost', 'ChangeValue', 'Constraint', 'Decision', 'DecisionBuilder', 'DefaultPhaseParameters', 'DefaultRoutingModelParameters', 'DefaultRoutingSearchParameters', 'Demon', 'DisjunctiveConstraint', 'FindErrorInRoutingSearchParameters', 'FirstSolutionStrategy', 'GlobalVehicleBreaksConstraint', 'IntExpr', 'IntVar', 'IntVarContainer', 'IntVarElement', 'IntVarIterator', 'IntVarLocalSearchFilter', 'IntVarLocalSearchOperator', 'IntervalVar', 'IntervalVarContainer', 'IntervalVarElement', 'LocalSearchFilter', 'LocalSearchFilterManager', 'LocalSearchMetaheuristic', 'LocalSearchOperator', 'NumericalRevInteger', 'OptimizeVar', 'Pack', 'PathOperator', 'PathsMetadata', 'PropagationBaseObject', 'PyConstraint', 'PyConstraintDemon', 'PyDecision', 'PyDecisionBuilder', 'PyDemon', 'RevBool', 'RevInteger', 'RoutingDimension', 'RoutingIndexManager', 'RoutingModel', 'RoutingModelVisitor', 'SearchLimit', 'SearchMonitor', 'SequenceVar', 'SequenceVarContainer', 'SequenceVarElement', 'SimpleBoundCosts', 'SolutionCollector', 'SolveModelWithSat', 'Solver', 'TypeIncompatibilityChecker', 'TypeRegulationsChecker', 'TypeRegulationsConstraint', 'TypeRequirementChecker', '_SwigNonDynamicMeta', '__builtin__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__lshift__', '__name__', '__package__', '__spec__', '_pywrapcp', '_swig_add_metaclass', '_swig_python_version_info', '_swig_repr', '_swig_setattr_nondynamic_class_variable', '_swig_setattr_nondynamic_instance_variable', 'cvar', 'weakref']
**Accessing DefaultRoutingSearchParameters via pywrapcp.DefaultRoutingSearchParameters():**
Error initializing DefaultRoutingSearchParameters: Couldn't build proto file into descriptor pool: Invalid default '0.5' for field operations_research.sat.SatParameters.clause_cleanup_ratio of type 1

What did you expect to see
I would expect to just initialize the DefaultRoutingSearchParameters with its default parameter

What did you see instead?
Error initializing DefaultRoutingSearchParameters: Couldn't build proto file into descriptor pool: Invalid default '0.5' for field operations_research.sat.SatParameters.clause_cleanup_ratio of type 1

Make sure you include information that can help us debug (full error message, model Proto).
I am quiet inexperienced with it and I just really noticed that the only issue when this happened was within the Django context.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions