evhub / bbopt

Black box hyperparameter optimization made easy.
Apache License 2.0
75 stars 8 forks source link

TypeError: Cannot cast array data from dtype('<U4') to dtype('int64') according to the rule 'safe' #5

Closed sakalouski closed 5 years ago

sakalouski commented 5 years ago

Traceback (most recent call last): File "bayesian_opt_DL.py", line 137, in run_trial() File "bayesian_opt_DL.py", line 89, in run_trial bb.run() File "/home/b7066789/.local/lib/python3.6/site-packages/bbopt/optimizer.py", line 107, in run self.run_backend(backend, kwargs) File "/home/b7066789/.local/lib/python3.6/site-packages/bbopt/optimizer.py", line 95, in run_backend self.backend = init_backend(backend, self._examples, self._old_params, *args, *kwargs) File "/home/b7066789/.local/lib/python3.6/site-packages/bbopt/registry.py", line 105, in init_backend return backend_registry[name](examples, params, args, kwargs) File "/home/b7066789/.local/lib/python3.6/site-packages/bbopt/backends/hyperopt.py", line 137, in init (next)(FMinIter(algo, domain, trials, rstate, kwargs)) File "/home/b7066789/.local/lib/python3.6/site-packages/hyperopt/fmin.py", line 237, in next self.run(1, block_until_done=self.asynchronous) File "/home/b7066789/.local/lib/python3.6/site-packages/hyperopt/fmin.py", line 202, in run self.rstate.randint(2 31 - 1)) File "/home/b7066789/.local/lib/python3.6/site-packages/hyperopt/tpe.py", line 901, in suggest print_node_on_error=False) File "/home/b7066789/.local/lib/python3.6/site-packages/hyperopt/pyll/base.py", line 913, in rec_eval rval = scope._impls[node.name](*args, **kwargs) File "/home/b7066789/.local/lib/python3.6/site-packages/hyperopt/pyll/base.py", line 1076, in bincount return np.bincount(x, weights, minlength) TypeError: Cannot cast array data from dtype('<U4') to dtype('int64') according to the rule 'safe'

evhub commented 5 years ago

@sakalouski Do you have code I can run to reproduce this error? It's hard for me to figure out what's causing this error without being able to reproduce it myself.

evhub commented 5 years ago

@sakalouski Also, try updating your BBopt (pip install -U bbopt) and seeing if the error is still there--it's possible this error has been fixed in recent versions.

sakalouski commented 5 years ago

It was the same code as in the other issue. I got it after 12 iterations, which is weird. I used the last version of BBopt

evhub commented 5 years ago

@sakalouski This error should now be fixed in the most recent version of BBopt! Just pip install -U bbopt to get the updated version.