solve() incompatible function arguments Error

286 views
Skip to first unread message

arnaban...@gmail.com

unread,
Feb 8, 2024, 2:45:36 PM2/8/24
to or-tools-discuss
ORTools version: 9.8.3753
OS: Ubuntu 22.04 (WSL2 on Windows 10 Pro 22H2)
Solver: CP-SAT
Language: Python

When running the solver it generated an error file which is 7.8 GB in size with all the list of variables in the model. The top few lines are as follows:

Traceback (most recent call last):
  File "/mnt/d/Arnab/ubuntu/test.py", line 529, in <module>
    main()
  File "/mnt/d/Arnab/ubuntu/test.py", line 526, in main
    solve(create_data_model())
  File "/mnt/d/Arnab/ubuntu/test.py", line 431, in solve
    status = solver.solve(model, solution_callback)
  File "/home/qwixpert/.local/lib/python3.10/site-packages/ortools/sat/python/cp_model.py", line 3126, in solve
    self.__solution = self.__solve_wrapper.solve(model.proto)
TypeError: solve(): incompatible function arguments. The following argument types are supported:
    1. (self: ortools.sat.python.swig_helper.SolveWrapper, arg0: operations_research::sat::CpModelProto) -> operations_research::sat::CpSolverResponse

Invoked with: <ortools.sat.python.swig_helper.SolveWrapper object at 0x7fad323ea6f0>, variables {...

...list of every variable in the model

Laurent Perron

unread,
Feb 8, 2024, 2:49:55 PM2/8/24
to or-tools-discuss
In python, the limit is 2GB when serializing to C++. Can you build the model in C++ ?

arnaban...@gmail.com

unread,
Feb 8, 2024, 5:02:52 PM2/8/24
to or-tools-discuss
There are some stuffs apart from the solver which will require time to implement in C++. Can I just export proto and run it using sat_runner?

Laurent Perron

unread,
Feb 8, 2024, 5:21:24 PM2/8/24
to or-tools-discuss
No, that is the blocking part. 
Serializing the proto is limited to 2GB.

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/a029ce51-a92c-423e-829d-33307b7bc1cbn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages