linopy icon indicating copy to clipboard operation
linopy copied to clipboard

Bug: "cannot reshape array of size" after optimization is finished

Open tburandt opened this issue 11 months ago • 2 comments

Hi all,

sometimes I get randomly these errors when calling model.solve:

2024-11-13 15:05:34 [INFO]  Optimization successful: 
Status: ok
Termination condition: optimal
Solution: 3017580 primals, 254750 duals
Objective: 3.52e+08
Solver model: available
Solver message: optimal
 in constants.info:239
2024-11-13 15:05:34 [ERROR] Attempt 1 failed with error: cannot reshape array of size 65160 into shape (1086,30) in model_builder.solve:276

rebuilding the model (aka initializing a new model class and re-adding constraints variables, etc without andy data changes) usually solves this problem. However, I run 24h simulations for up to 5-6 years in total and every like 20 simulations, I get this error. Also, its not traceable and not really reproducible. It really occurs randomly and happens with cplex and highs

tburandt avatar Nov 13 '24 14:11 tburandt