Closed pamdla closed 11 months ago
import numpy as np from pymoo.algorithms.moo.nsga3 import NSGA3 from pymoo.factory import get_problem, get_reference_directions from pymoo.optimize import minimize from pymoo.problems.multi import TNK from pymoo.visualization.scatter import Scatter from pysamoo.algorithms.gpsaf import GPSAF problem = TNK() ref_dirs = get_reference_directions("das-dennis", 2, n_points=20) # create the algorithm object ## 1 algorithm = NSGA3(pop_size=20, n_offsprings=10, ref_dirs=ref_dirs) ## 2 algorithm = GPSAF(algorithm, alpha=10, beta=50, n_max_doe=100, ) ## 3 res = minimize( problem, algorithm, ('n_evals', 200), seed=1, verbose=True)
The full example codes are above.
When I test ##1 with ##3 there is no error, but if continuing using ##2 after ##1, then ##3 will prompt error like this:
File "mtrand.pyx", line 950, in numpy.random.mtrand.RandomState.choice ValueError: 'a' cannot be empty unless no samples are taken
The install numpy is 1.25.1, then I reinstall numpy to 1.20.0, still the error is there.
any suggestion?
what pymoo version are you using? Does the error also occur with only NSGA2?
Feel free to repost in the pysamoo framework as this is related to GPSAF.
GPSAF
The full example codes are above.
When I test ##1 with ##3 there is no error, but if continuing using ##2 after ##1, then ##3 will prompt error like this:
The install numpy is 1.25.1, then I reinstall numpy to 1.20.0, still the error is there.
any suggestion?