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

Invalid progress was set by the TerminationCriterion. #589

Open
ffent opened this issue Apr 30, 2024 · 1 comment
Open

Invalid progress was set by the TerminationCriterion. #589

ffent opened this issue Apr 30, 2024 · 1 comment
Assignees

Comments

@ffent
Copy link

ffent commented Apr 30, 2024

Hi,

I' currently using the NSGA2 algorithm to solve an ElementwiseProblem, but encounter an AssertionError after the 9th generation.

Error

Exception has occurred: AssertionError
Invalid progress was set by the TerminationCriterion.
  File "/home/mn-man.biz/k6803/Projects/man/Perception/man-devkit/scripts/split_scenes.py", line 439, in optimize_splits
    res = minimize(
  File "/home/mn-man.biz/k6803/Projects/man/Perception/man-devkit/scripts/split_scenes.py", line 612, in main
    indices = optimize_splits(list(elements.values()), list(splits.values()), objectives, seed=42)
  File "/home/mn-man.biz/k6803/Projects/man/Perception/man-devkit/scripts/split_scenes.py", line 628, in <module>
    main(src=args.src, dst=args.dst)
AssertionError: Invalid progress was set by the TerminationCriterion.

Settings

algorithm = NSGA2(
        pop_size=100,
        eliminate_duplicates=True,
        sampling=IntegerRandomSampling(),
        mutation=PM(prob=1.0, eta=3.0, vtype=float, repair=RoundingRepair()),
        crossover=SBX(prob=1.0, eta=3.0, vtype=float, repair=RoundingRepair())
    )

termination = MaximumGenerationTermination(n_max_gen=10)

res = minimize(
        problem,
        algorithm,
        termination,
        verbose=True,
        seed=seed
    )

However, I'm a little bit confused about the fact that a simple MaximumGenerationTermination can encounter an error like "Invalid progress was set by the TerminationCriterion". Can anyone give me a hint?

Stack trace

Click to expand
==========================================================================================
n_gen  |  n_eval  | n_nds  |     cv_min    |     cv_avg    |      eps      |   indicator  
==========================================================================================
     1 |      100 |      1 |  0.3749000000 |  0.5946500000 |             - |             -
     2 |      200 |      1 |  0.3499000000 |  0.4839000000 |             - |             -
     3 |      300 |      1 |  0.2749000000 |  0.4164000000 |             - |             -
     4 |      400 |      1 |  0.1999000000 |  0.3529000000 |             - |             -
     5 |      500 |      1 |  0.1749000000 |  0.2949000000 |             - |             -
     6 |      600 |      1 |  0.0749000000 |  0.2306500000 |             - |             -
     7 |      700 |      1 |  0.0249000000 |  0.1736500000 |             - |             -
     8 |      800 |      1 |  0.0249000000 |  0.1176500000 |             - |             -
/venv/lib/python3.8/site-packages/pymoo/operators/survival/rank_and_crowding/metrics.py:97: RuntimeWarning: invalid value encountered in subtract
  dist = np.row_stack([F, np.full(n_obj, np.inf)]) - np.row_stack([np.full(n_obj, -np.inf), F])
/venv/lib/python3.8/site-packages/pymoo/operators/survival/rank_and_crowding/metrics.py:105: RuntimeWarning: invalid value encountered in divide
  dist_to_last, dist_to_next = dist_to_last[:-1] / norm, dist_to_next[1:] / norm
     9 |      900 |      5 |  0.000000E+00 |  0.0679050000 |             - |             -
/venv/lib/python3.8/site-packages/pymoo/termination/ftol.py:14: RuntimeWarning: invalid value encountered in subtract
  return np.max(np.abs((a - b) / norm))
venv/lib/python3.8/site-packages/pymoo/util/normalization.py:86: RuntimeWarning: invalid value encountered in subtract
  N[..., neither_nan] = (X[..., neither_nan] - xl[neither_nan]) / (xu[neither_nan] - xl[neither_nan])
/venv/lib/python3.8/site-packages/pymoo/util/normalization.py:86: RuntimeWarning: invalid value encountered in divide
  N[..., neither_nan] = (X[..., neither_nan] - xl[neither_nan]) / (xu[neither_nan] - xl[neither_nan])
@blankjul
Copy link
Collaborator

blankjul commented May 2, 2024

Can you quickly check if either the objective values or the constraint values are NaN?
This is what I assume is going on looking at the error message.

@blankjul blankjul self-assigned this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants