ConfigSpace
ConfigSpace copied to clipboard
TypeError: Expected float, got numpy.float64 when using Float
Hello, It seems like that is an error when trying to use the Float function, more specifically due to the function:
def check_default(self, default_value: Optional[float]) -> float:
if default_value is None:
if self.log:
default_value = np.exp((np.log(self.lower) + np.log(self.upper)) / 2.)
else:
default_value = (self.lower + self.upper) / 2.
default_value = np.round(float(default_value), 10)
if self.is_legal(default_value):
return default_value
else:
raise ValueError("Illegal default value %s" % str(default_value))
inside class UniformFloatHyperparameter(FloatHyperparameter).
When calling np.round, a numpy.float64 is returned and the function is expecting a 'float'.
I am using configspace 0.7.2 and numpy 1.25