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: Expected float, got numpy.float64 #362

Closed
wadieskaf opened this issue May 30, 2024 · 1 comment
Closed

TypeError: Expected float, got numpy.float64 #362

wadieskaf opened this issue May 30, 2024 · 1 comment

Comments

@wadieskaf
Copy link

wadieskaf commented May 30, 2024

There is an issue with this file:

ConfigSpace/hyperparameters/uniform_float.pyx:124: TypeError: Expected float, got numpy.float64

It occurs when attempting to create a UniformFloatHyperparameter with or without passing a default value.

I think the issue is casting to float before rounding instead of doing the opposite.

Original code: default_value = np.round(float(default_value), 10)

Suggested fix: default_value = float(np.round(default_value, 10))

Python version: 3.11.9
configspace: 0.7.2

Note: the error does not exist when using Python v3.9.19 with configspace v0.6.1

Crylab added a commit to Crylab/ConfigSpace that referenced this issue Jul 3, 2024
@eddiebergman
Copy link
Contributor

Sorry, this was fixed in #346 long before you raised the PR, the problem was getting a review and merging it. This should be fixed in 1.0.0 which was just released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants