PKU-DAIR / open-box

Generalized and Efficient Blackbox Optimization System
https://open-box.readthedocs.io
Other
356 stars 52 forks source link

run_test crashes with "Argument 'default_value' has incorrect type" #69

Open Kaduo opened 9 months ago

Kaduo commented 9 months ago

When trying to run the tests after installing openbox in a fresh virtual environment (python 3.11), I get the following error:

File "/home/user/test.py", line 4, in <module>
    run_test()

  File "/home/user/.venv/lib/python3.11/site-packages/openbox/utils/test_install.py", line 21, in run_test
    x1 = sp.Real("x1", -5, 10, default_value=0)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/user/.venv/lib/python3.11/site-packages/openbox/utils/space.py", line 99, in __init__
    super().__init__(name=name, lower=lower, upper=upper,

  File "ConfigSpace/hyperparameters.pyx", line 669, in ConfigSpace.hyperparameters.UniformFloatHyperparameter.__init__

TypeError: Argument 'default_value' has incorrect type (expected float, got int)
jhj0411jhj commented 8 months ago

Thanks for the issue. It seems to be an incompatibility bug between the ConfigSpace package and python3.11 (or cython). (See https://github.com/automl/ConfigSpace/issues/336) Upgrade Configspace to 0.7.1 will fix it (via pip install ConfigSpace==0.7.1), or use python 3.10 instead. We are doing more test to find a better solution.