Describe the bug
I am running into an invalid search space bound error (Cannot generate a random real if the lower bound is larger than the upper bound, raised by the uniform_real_from_range_checks function declared in pagmo/utils/generic.hpp) when using the Monotonic Basin Hopping meta-algorithm, wrapping the NLOPT NEWUOA algorithm.
The bug happens after many successful iterations (196847 objective function evaluations as per the get_log method of the pg.mbh object), and I can consistently replicate it in my machine.
To Reproduce
Single-objective optimization using:
Archipelago with
64 islands
10000 individuals in each island
Unconnected topology (pygmo.unconnected) - the error replicates as well when using other topologies such as pg.fully_connected
Evolution for 1 evolutionary period (archi.evolve(n=1))
Problem search space is n-dimensional unit hypercube. Input is bounded to the unit hypercube by implementing the get_bounds method (see code block below) of the UDP
MBH wrapping NLOPT NEWUOA algorithm
get_bounds implemented in my UDP:
def get_bounds(self) -> list[list[float]]:
"""Search space bounds"""
return ([0]*self.problem_dimension, [1]*self.problem_dimension)
Expected behavior
Optimization completes without raising errors.
Error log
The following error is raised after 196847 objective function evaluations:
Traceback (most recent call last):
File "<string>", line 1, in <module>
RuntimeError: The asynchronous evolution of a pythonic island of type 'Multiprocessing island' raised an error:
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "c:\Users\antonio.lopez\AppData\Local\miniconda3\envs\combinatorial\lib\multiprocessing\pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "c:\Users\antonio.lopez\AppData\Local\miniconda3\envs\combinatorial\lib\site-packages\pygmo\_py_islands.py", line 26, in _evolve_func_mp_pool
new_pop = algo.evolve(pop)
ValueError:
function: uniform_real_from_range_checks
where: D:\bld\pagmo_1684216380930\work\include\pagmo/utils/generic.hpp, 79
what: Cannot generate a random real if the lower bound is larger than the upper bound
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\Users\antonio.lopez\AppData\Local\miniconda3\envs\combinatorial\lib\site-packages\pygmo\_py_islands.py", line 246, in run_evolve
return loads(res.get())
File "c:\Users\antonio.lopez\AppData\Local\miniconda3\envs\combinatorial\lib\multiprocessing\pool.py", line 774, in get
raise self._value
ValueError:
function: uniform_real_from_range_checks
where: D:\bld\pagmo_1684216380930\work\include\pagmo/utils/generic.hpp, 79
what: Cannot generate a random real if the lower bound is larger than the upper bound
Environment (please complete the following information):
OS: Windows 11 (version: 23H2)
Installation method: conda 24.1.1
Version: 2.19.5
Additional context
Can provide more information as needed.
I have run into the same bug when using MBH wrapping the Scipy CG optimizer. I will update this comment to include all inner optimizers with which I've ran into this problem:
Describe the bug I am running into an invalid search space bound error (
Cannot generate a random real if the lower bound is larger than the upper bound
, raised by theuniform_real_from_range_checks
function declared inpagmo/utils/generic.hpp
) when using the Monotonic Basin Hopping meta-algorithm, wrapping the NLOPT NEWUOA algorithm.The bug happens after many successful iterations (196847 objective function evaluations as per the
get_log
method of thepg.mbh
object), and I can consistently replicate it in my machine.To Reproduce Single-objective optimization using:
pygmo.unconnected
) - the error replicates as well when using other topologies such aspg.fully_connected
archi.evolve(n=1)
)get_bounds
method (see code block below) of the UDPget_bounds
implemented in my UDP:Expected behavior Optimization completes without raising errors.
Error log The following error is raised after 196847 objective function evaluations:
Environment (please complete the following information):
Additional context Can provide more information as needed.