Pyomo / pyomo

An object-oriented algebraic modeling language in Python for structured optimization problems.
https://www.pyomo.org
Other
2.03k stars 518 forks source link

BARON results not loading #754

Closed salvadorgarciamunoz closed 1 year ago

salvadorgarciamunoz commented 5 years ago

After solving a model with Baron directly

solver = SolverFactory('baron') results=solver.solve(model)

I get the below error:

File "/Users/c184156/anaconda3/envs/mypyomo55/lib/python3.6/site-packages/pyomo/solvers/plugins/solvers/BARON.py", line 286, in process_logfile results.solver.statistics['Convexity_cuts'] = int(line.split()[1])

ValueError: invalid literal for int() with base 10: 'exploitation'

The error seems to come from the BARON.py routine at the time the results are loaded from BARON.

I can provide files to reproduce the error

sal dot garcia at lilly dot com

blnicho commented 5 years ago

@salvadorgarciamunoz could you run it again with the tee=True option when calling the solver and post the last few lines of the solver log? I want to verify that Baron is finding a solution.

solver.solve(model, tee=True)
salvadorgarciamunoz commented 5 years ago

Output below, looks like Baron is looking for CPLEX (??)

===========================================================================
 BARON version 18.11.12. Built: OSX-64 Mon Nov 12 23:20:02 EST 2018

 BARON is a product of The Optimization Firm.
 For information on BARON, see https://minlp.com/about-baron
 Licensee: Salvador Garcia Munoz at Eli Lilly and Company, sal.garcia@lilly.com.
 Changing option LPSol to 8 (CLP) and continuing.

 If you use this software, please cite publications from
 https://minlp.com/baron-publications, such as: 

 Kilinc, M. and N. V. Sahinidis, Exploiting integrality in the global
 optimization of mixed-integer nonlinear programming problems in BARON,
 Optimization Methods and Software, 33, 540-562, 2018.
===========================================================================
 This BARON run may utilize the following subsolver(s)
 For LP/MIP: CLP/CBC                                         
 For NLP: IPOPT, FILTERSD, FILTERSQP
===========================================================================
 Doing local search
 Preprocessing found feasible solution with value  0.00000000000     
 Problem solved during preprocessing
 Lower bound is -.100000000000E-005

 Cleaning up

                         *** Normal completion ***            

 LP  subsolver time:                  0.00
 MIP subsolver time:                  0.00
 NLP subsolver time:                  0.01
 Fixed-NLP subsolver time:            0.00
 Max LP subsolver time:              -1.00
 Max NLP subsolver time:              0.01
 Row management time:                 0.00
 MIP management time:                 0.00
 Total PW relaxation time:            0.00
 Cutting time:                       -0.00
 All other time:                      0.02

 Wall clock time:                     0.00
 Total CPU time used:                 0.03
       on presolving:                 0.00
       on parsing:                    0.01
       on preprocessing:              0.02
       on navigating:                 0.01
       on relaxed:                    0.00
       on local:                      0.00
       on tightening:                 0.00
       on preprobe:                   0.00
       on marginals:                  0.00
       on strong branching:           0.00
       on probing:                    0.00
       on iscvx:                      0.00
       on IIS detection:              0.00
       on ad:                         0.00
               number of calls      CPU time
         objfunc:        13           0.00
         confunc:        13           0.00
         objgrad:         6           0.00
         congrad:         6           0.00
         hessian:         2           0.00

 Total no. of BaR iterations:      -1
 Best solution found at node:      -1
 Max. no. of nodes in memory:       0

 Convexity exploitation statistics
   no. of cvx expressions identified:        256
   Total no. of cvx cuts generated:            0
   Time spent on cvx cuts:                     0.00
   Time spent on recognition:                  0.00
   Time spent on initial OA:                   0.00
   Time spent on generating cuts:              0.00
   Time spent on range reductions:             0.00

  MIP cuts generation statistics
   no. of mip cuts:                               0
   Time (s) spent on MIP cuts:                 0.00
      Cut Pool:                                0.00
      Implication Identification:              0.00
      Conflict Identification:                 0.00
      Implication Cuts:                        0.00
      Clique Cuts:                             0.00
      Knapsack Cover Cuts:                     0.00
      Knapsack w/ Gub Cover Cuts:              0.00
      Flow Cover Cuts:                         0.00

 Number of coefficient reductions identified            4
 Number of reduction rows identified                    4
 Number of times coefficients were reduced              0
 Number of implications identified                      8
 Number of implication cuts generated                   0
 Number of conflicts identified                         0
 Number of clique cuts generated                        0
 Number of knapsack cover cuts generated                0
 Number of knapsack w/gub covercuts generated           0
 Number of flow cover cuts generated                    0

 Convex transformable cut generation statistics
   Time spent on cuts:                         0.00
   Total no. of functions identified:          0
   Total no. of cuts generated:                0

 MOL cut generation statistics
  Time spent on cuts:                          0.00
  Total no. of expressions identified:         0
  - Number of Lennard-Jones functions:         0
  - Number of triplets:                        0
  Total no. of cuts generated:                 0

 KKT-based reduction statistics:    
   Calls of kktdo subroutine: (Success / Call)
   KKTmido                         0                 0
   KKToido                         0                 0
   KKTuncdo                        0                 0
   Missing branching opportunities:                  0
   Maximum percentage of missed branching values:    0.00
   Minimum percentage of missed branching values:    0.00
   Average percentage of missed branching values:    0.00
   Detected 0 redundant constraints at most from 6 equations

 Eigenvalue relaxations statistics
                                          Number         CPU time
  Eigenvalue calculations                     0           0.00
  Generalized eigenvalue calculations         0           0.00

 BQP relaxations statistics
  Time spent on recognition:                    0.00
  Number of vertices in the bilinear graph:        0
  Number of edges in the bilinear graph:           0
  Density of the bilinear graph [%]:             0.0
  Chordality of the bilinear graph:                F
  Number of chordless cycles:                      0
  Minimum length of the chordless cycles:          0
  Maximum length of the chordless cycles:          0
  Number of cycles of length 4:                    0
  Number of cycles of length 5:                    0
  Number of cycles of length 6:                    0
  Number of cycles of length 7:                    0
  Number of cycles of length 8:                    0
  Number of cuts for cycles of length 4:           0
  Number of cuts for cycles of length 5:           0
  Number of cuts for cycles of length 6:           0
  Number of cuts for cycles of length 7:           0
  Number of cuts for cycles of length 8:           0
  Separation time for cycles of length 4:       0.00
  Separation time for cycles of length 5:       0.00
  Separation time for cycles of length 6:       0.00
  Separation time for cycles of length 7:       0.00
  Separation time for cycles of length 8:       0.00
  Total time spent on cut generation:           0.00

 Number of MIP relaxations solved                       0
 Number of LP relaxations solved                        0

 Number of MIP infeasibilities ignored       0 out of 0 
 Number of wrong solutions caught in barlp   0 out of 0 
 Incorrect infeasibility claims in barlp     0 out of 0 from 0 
 Number of wrong solutions caught in barnlps 0 out of 1 

 Cut generation statistics (number of cuts / CPU sec)
   Bilinear                         0         0.00
   LD-Envelopes                     0         0.00
   Multilinears                     0         0.00
   Edge concave                     0         0.00
   RLT                              0         0.00
   Convexity                        0         0.00
   Integrality                      0         0.00
   CTFs                             0         0.00
   MOL                              0         0.00
   BOOL                             0         0.00
   BINQP                            0         0.00

 All done
===========================================================================
 Unable to find/load CPLEX library dlopen(libcplex.dylib, 1): image not found
 Unable to find/load CPLEX library dlopen(libcplex1280.dylib, 1): image not found
Traceback (most recent call last):

  File "<ipython-input-1-62b6a2cefd09>", line 1, in <module>
    runfile('/SGMFiles/PythonCode/Abemaciclib/untitled0.py', wdir='/SGMFiles/PythonCode/Abemaciclib')

  File "/Users/c184156/anaconda3/envs/mypyomo55/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 668, in runfile
    execfile(filename, namespace)

  File "/Users/c184156/anaconda3/envs/mypyomo55/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py", line 108, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/SGMFiles/PythonCode/Abemaciclib/untitled0.py", line 6, in <module>
    rhat,rIhat,ssr,mod,res=eiot.calc(Dm[1,:],eiot_obj_7,0.0521116)

  File "/SGMFiles/PythonCode/pyEIOT/eiot.py", line 355, in calc
    results=solver.solve(model,tee=True)

  File "/Users/c184156/anaconda3/envs/mypyomo55/lib/python3.6/site-packages/pyomo/opt/base/solvers.py", line 631, in solve
    result = self._postsolve()

  File "/Users/c184156/anaconda3/envs/mypyomo55/lib/python3.6/site-packages/pyomo/opt/solver/shellcmd.py", line 268, in _postsolve
    results = self.process_output(self._rc)

  File "/Users/c184156/anaconda3/envs/mypyomo55/lib/python3.6/site-packages/pyomo/opt/solver/shellcmd.py", line 324, in process_output
    results = self.process_logfile()

  File "/Users/c184156/anaconda3/envs/mypyomo55/lib/python3.6/site-packages/pyomo/solvers/plugins/solvers/BARON.py", line 286, in process_logfile
    results.solver.statistics['Convexity_cuts'] = int(line.split()[1])

ValueError: invalid literal for int() with base 10: 'exploitation'
blnicho commented 5 years ago

I suspect this is a bug in the BARON interface. Seems like the BARON reader is not very robust and using a hard-coded line number to parse the log file.

mrmundt commented 1 year ago

@salvadorgarciamunoz - I am going through old issues and checking to see if they are still concerns. Are you having any of these issues with the newer versions of BARON and/or Pyomo?

salvadorgarciamunoz commented 1 year ago

I have not tested this in a while, let me give it whirl, I have been using BARON through GAMS, but I will let you know.

From: mrmundt @.> Sent: Tuesday, February 14, 2023 2:17 PM To: Pyomo/pyomo @.> Cc: Garcia Munoz, Salvador @.>; Mention @.> Subject: Re: [Pyomo/pyomo] BARON results not loading (#754)

This email from @.*** originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders listhttps://spam.ic.ac.uk/SpamConsole/Senders.aspx to disable email stamping for this address.

@salvadorgarciamunozhttps://github.com/salvadorgarciamunoz - I am going through old issues and checking to see if they are still concerns. Are you having any of these issues with the newer versions of BARON and/or Pyomo?

— Reply to this email directly, view it on GitHubhttps://github.com/Pyomo/pyomo/issues/754#issuecomment-1430254937, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG6JFJ4MCPIEXFIYNZO4IITWXPKY5ANCNFSM4GFM6A6A. You are receiving this because you were mentioned.Message ID: @.***>

blnicho commented 1 year ago

@salvadorgarciamunoz we're going to close this. If you have issues with BARON in the future please open a new issue.