current["nadir"] and current["ideal"] are NoneType
See original GitHub issueHello,
When I use the default termination, I got below error:
File "/home/dev/miniconda3/envs/dev/lib/python3.10/site-packages/pymoo/core/algorithm.py", line 309, in _post_advance
self.termination.update(self)
File "/home/dev/miniconda3/envs/dev/lib/python3.10/site-packages/pymoo/core/termination.py", line 28, in update
progress = self._update(algorithm)
File "/home/dev/miniconda3/envs/dev/lib/python3.10/site-packages/pymoo/termination/default.py", line 24, in _update
p = [criterion.update(algorithm) for criterion in self.criteria]
File "/home/dev/miniconda3/envs/dev/lib/python3.10/site-packages/pymoo/termination/default.py", line 24, in <listcomp>
p = [criterion.update(algorithm) for criterion in self.criteria]
File "/home/dev/miniconda3/envs/dev/lib/python3.10/site-packages/pymoo/core/termination.py", line 28, in update
progress = self._update(algorithm)
File "/home/dev/miniconda3/envs/dev/lib/python3.10/site-packages/pymoo/termination/robust.py", line 32, in _update
perc = self.termination.update(algorithm)
File "/home/dev/miniconda3/envs/dev/lib/python3.10/site-packages/pymoo/core/termination.py", line 28, in update
progress = self._update(algorithm)
File "/home/dev/miniconda3/envs/dev/lib/python3.10/site-packages/pymoo/termination/delta.py", line 42, in _update
delta = self._delta(prev, current)
File "/home/dev/miniconda3/envs/dev/lib/python3.10/site-packages/pymoo/termination/ftol.py", line 71, in _delta
norm = current["nadir"] - current["ideal"]
TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'
How to fix the None issue and why did it come out? Thanks!
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, I have the same problem. Don’t think this code is tested very well. What I basically did was add some checks to make sure those values exist. I don’t know if this is entirely correct, as I’ve seen many times that ftol is reached, but it just doesn’t converge. I’m guessing it’s because of these conditions.
Sorry for the delay. That was indeed a bug which should be fixed now!