Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sakalouski opened this issue Feb 22, 2019 · 4 comments
Labels

Comments

@sakalouski
Copy link

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
Copy link
Owner

evhub commented Feb 22, 2019

@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 evhub added the bug label Feb 22, 2019
@evhub
Copy link
Owner

evhub commented Feb 24, 2019

@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
Copy link
Author

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
Copy link
Owner

evhub commented Feb 26, 2019

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

@evhub evhub closed this as completed Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants