Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization Run Stop Exception #1092

Open
boverhof opened this issue Dec 1, 2022 · 1 comment
Open

Optimization Run Stop Exception #1092

boverhof opened this issue Dec 1, 2022 · 1 comment
Assignees
Labels
Priority:Normal Normal Priority Issue or PR

Comments

@boverhof
Copy link
Member

boverhof commented Dec 1, 2022

2022-12-01 03:06:39,645 - DEBUG - foqus.foqus_lib.framework.optimizer.problem - I: 0
2022-12-01 03:06:39,645 - DEBUG - foqus.foqus_lib.framework.optimizer.problem - X: {'graph': {}, 'BFB': {'BFBadsB.Dt': 11.897, 'BFBadsB.dx': 0.0127, 'BFBadsB.Lb': 2.085, 'BFBadsM.Dt': 15, 'BFBadsM.dx': 0.06695, 'BFBadsM.Lb': 1.972, 'BFBadsT.Dt': 15, 'BFBadsT.dx': 0.06239700000000001, 'BFBadsT.Lb': 2.2029999999999994, 'BFBRGN.Dt': 9.041, 'BFBRGN.Lb': 8.886, 'BFBRGNTop.Dt': 9.195, 'BFBRGNTop.Lb': 7.1926, 'GHXfg.A_exch': 16358, 'Kd': 100, 'BFBadsB.Cr': 1, 'BFBadsM.Cr': 1, 'BFBadsT.Cr': 1, 'BFBRGN.Cr': 1, 'BFBRGNTop.Cr': 1, 'dp': 0.000126, 'GHXfg.GasIn.P': 1.01325, 'GHXfg.GasIn.T': 54, 'fg_flow': 70263.9}}
2022-12-01 03:06:39,645 - DEBUG - foqus.foqus_lib.framework.optimizer.problem - I: 1
2022-12-01 03:06:39,645 - DEBUG - foqus.foqus_lib.framework.optimizer.problem - X: {'graph': {}, 'BFB': {'BFBadsB.Dt': 11.897, 'BFBadsB.dx': 0.0127, 'BFBadsB.Lb': 2.085, 'BFBadsM.Dt': 15, 'BFBadsM.dx': 0.06695, 'BFBadsM.Lb': 1.972, 'BFBadsT.Dt': 15, 'BFBadsT.dx': 0.06239700000000001, 'BFBadsT.Lb': 2.2029999999999994, 'BFBRGN.Dt': 9.041, 'BFBRGN.Lb': 8.886, 'BFBRGNTop.Dt': 9.195, 'BFBRGNTop.Lb': 7.1926, 'GHXfg.A_exch': 16358, 'Kd': 100, 'BFBadsB.Cr': 1, 'BFBadsM.Cr': 1, 'BFBadsT.Cr': 1, 'BFBRGN.Cr': 1, 'BFBRGNTop.Cr': 1, 'dp': 0.0001402, 'GHXfg.GasIn.P': 1.01325, 'GHXfg.GasIn.T': 54, 'fg_flow': 70263.9}}
2022-12-01 03:06:39,661 - DEBUG - foqus.foqus_lib.framework.optimizer.problem - I: 2
2022-12-01 03:06:39,661 - DEBUG - foqus.foqus_lib.framework.optimizer.problem - X: {'graph': {}, 'BFB': {'BFBadsB.Dt': 11.897, 'BFBadsB.dx': 0.0127, 'BFBadsB.Lb': 2.085, 'BFBadsM.Dt': 15, 'BFBadsM.dx': 0.06695, 'BFBadsM.Lb': 1.972, 'BFBadsT.Dt': 15, 'BFBadsT.dx': 0.06239700000000001, 'BFBadsT.Lb': 2.2029999999999994, 'BFBRGN.Dt': 9.041, 'BFBRGN.Lb': 8.886, 'BFBRGNTop.Dt': 9.195, 'BFBRGNTop.Lb': 7.1926, 'GHXfg.A_exch': 16358, 'Kd': 100, 'BFBadsB.Cr': 1, 'BFBadsM.Cr': 1, 'BFBadsT.Cr': 1, 'BFBRGN.Cr': 1, 'BFBRGNTop.Cr': 1, 'dp': 0.00015, 'GHXfg.GasIn.P': 1.01325, 'GHXfg.GasIn.T': 54, 'fg_flow': 70263.9}}
2022-12-01 03:06:39,661 - DEBUG - foqus.foqus_lib.framework.optimizer.problem - I: 3
2022-12-01 03:06:39,661 - DEBUG - foqus.foqus_lib.framework.optimizer.problem - X: {'graph': {}, 'BFB': {'BFBadsB.Dt': 11.897, 'BFBadsB.dx': 0.0127, 'BFBadsB.Lb': 2.085, 'BFBadsM.Dt': 15, 'BFBadsM.dx': 0.06695, 'BFBadsM.Lb': 1.972, 'BFBadsT.Dt': 15, 'BFBadsT.dx': 0.06239700000000001, 'BFBadsT.Lb': 2.2029999999999994, 'BFBRGN.Dt': 9.041, 'BFBRGN.Lb': 8.886, 'BFBRGNTop.Dt': 9.195, 'BFBRGNTop.Lb': 7.1926, 'GHXfg.A_exch': 16358, 'Kd': 100, 'BFBadsB.Cr': 1, 'BFBadsM.Cr': 1, 'BFBadsT.Cr': 1, 'BFBRGN.Cr': 1, 'BFBRGNTop.Cr': 1, 'dp': 0.0001598, 'GHXfg.GasIn.P': 1.01325, 'GHXfg.GasIn.T': 54, 'fg_flow': 70263.9}}
2022-12-01 03:06:39,661 - DEBUG - foqus.foqus_lib.framework.optimizer.problem - I: 4
2022-12-01 03:06:39,661 - DEBUG - foqus.foqus_lib.framework.optimizer.problem - X: 0
2022-12-01 03:06:39,661 - ERROR - foqus.foqus_lib.framework.optimizer.optimization - Exception in optimization thread
Traceback (most recent call last):
  File "c:\users\administrator\desktop\foqus\foqus_lib\framework\optimizer\optimization.py", line 96, in run
    self.optimize()
  File "c:\users\administrator\desktop\foqus\foqus_lib\framework\optimizer\BFGS.py", line 223, in optimize
    ores = scipy.optimize.minimize(
  File "C:\ProgramData\Anaconda3\envs\foqus\lib\site-packages\scipy\optimize\_minimize.py", line 699, in minimize
    res = _minimize_lbfgsb(fun, x0, args, jac, bounds,
  File "C:\ProgramData\Anaconda3\envs\foqus\lib\site-packages\scipy\optimize\_lbfgsb_py.py", line 308, in _minimize_lbfgsb
    sf = _prepare_scalar_function(fun, x0, jac=jac, args=args, epsilon=eps,
  File "C:\ProgramData\Anaconda3\envs\foqus\lib\site-packages\scipy\optimize\_optimize.py", line 263, in _prepare_scalar_function
    sf = ScalarFunction(fun, x0, args, grad, hess,
  File "C:\ProgramData\Anaconda3\envs\foqus\lib\site-packages\scipy\optimize\_differentiable_functions.py", line 158, in __init__
    self._update_fun()
  File "C:\ProgramData\Anaconda3\envs\foqus\lib\site-packages\scipy\optimize\_differentiable_functions.py", line 251, in _update_fun
    self._update_fun_impl()
  File "C:\ProgramData\Anaconda3\envs\foqus\lib\site-packages\scipy\optimize\_differentiable_functions.py", line 155, in update_fun
    self.f = fun_wrapped(self.x)
  File "C:\ProgramData\Anaconda3\envs\foqus\lib\site-packages\scipy\optimize\_differentiable_functions.py", line 137, in fun_wrapped
    fx = fun(np.copy(x), *args)
  File "c:\users\administrator\desktop\foqus\foqus_lib\framework\optimizer\BFGS.py", line 150, in f
    objValues, cv, pv = self.prob.runSamples([x], self)
  File "c:\users\administrator\desktop\foqus\foqus_lib\framework\optimizer\problem.py", line 366, in runSamples
    return self.calculateObj(gt.res, nsamples=snum)
  File "c:\users\administrator\desktop\foqus\foqus_lib\framework\optimizer\problem.py", line 422, in calculateObj
    (x, f) = self.get_at_dicts(x, f)
  File "c:\users\administrator\desktop\foqus\foqus_lib\framework\optimizer\problem.py", line 497, in get_at_dicts
    x[i] = AtDict(x[i])
TypeError: 'int' object is not iterable
@boverhof boverhof self-assigned this Dec 1, 2022
@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Dec 6, 2022
@ksbeattie ksbeattie moved this to In Progress in 2022 Dec Release Dec 6, 2022
@ksbeattie
Copy link
Member

Stopping is known to not always work the first time, hitting stop a few times more usually works.

We should try to reproduce this via one of the optimization examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Normal Normal Priority Issue or PR
Projects
None yet
Development

No branches or pull requests

2 participants