HEBO Error (ValueError: Unsupported dtype object)

Hello. I noticed a new search algorithm was added recently (HEBOSearch) and decided to try it out. First, I attempted to use it on a Gym environment I created, but I received an error. I then found an example script and attempted to run it with no success, receiving the same error.

Here is the error:

Traceback (most recent call last):
File “/home/runedog48/.local/lib/python3.8/site-packages/hebo/acq_optimizers/evolution_optimizer.py”, line 119, in optimize
res = minimize(prob, algo, (‘n_gen’, self.iter), verbose = self.verbose)
File “/home/runedog48/.local/lib/python3.8/site-packages/pymoo/optimize.py”, line 85, in minimize
res = algorithm.solve()
File “/home/runedog48/.local/lib/python3.8/site-packages/pymoo/model/algorithm.py”, line 226, in solve
self._solve(self.problem)
File “/home/runedog48/.local/lib/python3.8/site-packages/pymoo/model/algorithm.py”, line 321, in _solve
self.next()
File “/home/runedog48/.local/lib/python3.8/site-packages/pymoo/model/algorithm.py”, line 246, in next
self._next()
File “/home/runedog48/.local/lib/python3.8/site-packages/pymoo/algorithms/genetic_algorithm.py”, line 93, in _next
self.off = self.mating.do(self.problem, self.pop, self.n_offsprings, algorithm=self)
File “/home/runedog48/.local/lib/python3.8/site-packages/pymoo/model/infill.py”, line 40, in do
_off = self.eliminate_duplicates.do(_off, pop, off)
File “/home/runedog48/.local/lib/python3.8/site-packages/pymoo/model/duplicate.py”, line 26, in do
pop = pop[~self._do(pop, None, np.full(len(pop), False))]
File “/home/runedog48/.local/lib/python3.8/site-packages/pymoo/model/duplicate.py”, line 75, in _do
D = self.calc_dist(pop, other)
File “/home/runedog48/.local/lib/python3.8/site-packages/pymoo/model/duplicate.py”, line 66, in calc_dist
D = cdist(X, X)
File “/home/runedog48/.local/lib/python3.8/site-packages/pymoo/util/misc.py”, line 90, in cdist
return scipy.spatial.distance.cdist(A, B, **kwargs)
File “/home/runedog48/.local/lib/python3.8/site-packages/scipy/spatial/distance.py”, line 2954, in cdist
return cdist_fn(XA, XB, out=out, **kwargs)
ValueError: Unsupported dtype object

I attempted to debug the function and find the problem, but I have no experience with any of these libraries. I found that XA and XB had a dtype of object; however, it expects a dtype of float.

Any help would be appreciated.

Thanks for letting us know, I will take a look. Have you modified the example code in any way?

I did not make any modifications.

E: After reviewing my package versions to provide more information, I discovered that the PIP package for HEBO is currently version 0.1.0; however, the repository is version 0.2.0. After correcting this, it appears that the example script and my Gym environment are working correctly.

I was unable to reproduce this issue. This is what I did:

  • Created a fresh virtual enviroment
  • Installed "ray[tune]" HEBO
  • Ran the example without any changes

Is it possible your HEBO or pymoo packages are outdated?

EDIT: Just seen your edit, glad you managed to solve it!