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

Depreciation of np.float causes incompatible numpy version #222

Open
tryingsomestuff opened this issue Jun 20, 2023 · 7 comments
Open

Depreciation of np.float causes incompatible numpy version #222

tryingsomestuff opened this issue Jun 20, 2023 · 7 comments

Comments

@tryingsomestuff
Copy link

  • Chess Tuning Tools version: chess-tuning-tools 0.9.3
  • Python version: 3.9.17
  • Operating System: ubuntu 22.04

Description

Depreciation of np.float causes incompatible numpy version
Version installed is

numpy 1.25.0

numpy version shall be <=1.19 with the given scikit-learn 0.23.2

Or am i missing something ?

@tryingsomestuff
Copy link
Author

tryingsomestuff commented Jun 20, 2023

Even with a pre-install numpy 1.19.1 it does work

vivien@serv3:~/Minic/tune$ pip3 install numpy==1.19.1
Collecting numpy==1.19.1
  Downloading numpy-1.19.1.zip (7.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.3/7.3 MB 15.6 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: numpy
  Building wheel for numpy (pyproject.toml) ... done
  Created wheel for numpy: filename=numpy-1.19.1-cp39-cp39-linux_x86_64.whl size=14035527 sha256=7e05409e624b838e8f45c3f9c4a1a5e907b983c7a0b58c08d979894335d942da
  Stored in directory: /home/vivien/.cache/pip/wheels/e0/85/4b/385d1720e1dd8bee99bac183aac3454e88aba9fc3146ccfc27
Successfully built numpy
Installing collected packages: numpy
Successfully installed numpy-1.19.1


vivien@serv3:~/Minic/tune$ pip3 install chess-tuning-tools
Collecting chess-tuning-tools
  Using cached chess_tuning_tools-0.9.3-py3-none-any.whl (48 kB)
Collecting Click<=8.0.4,>=7.1.2 (from chess-tuning-tools)
  Using cached click-8.0.4-py3-none-any.whl (97 kB)
Collecting atomicwrites>=1.4.0 (from chess-tuning-tools)
  Using cached atomicwrites-1.4.1-py2.py3-none-any.whl
Collecting bask<1.0.0,>=0.9.3 (from chess-tuning-tools)
  Using cached bask-0.10.8-py3-none-any.whl (32 kB)
Collecting dill>=0.3.4 (from chess-tuning-tools)
  Using cached dill-0.3.6-py3-none-any.whl (110 kB)
Requirement already satisfied: numpy>=1.19.1 in /home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages (from chess-tuning-tools) (1.19.1)
Collecting scikit-learn<0.24,>=0.22 (from chess-tuning-tools)
  Using cached scikit_learn-0.23.2-cp39-cp39-linux_x86_64.whl
Collecting scikit-optimize<0.9,>=0.8 (from chess-tuning-tools)
  Using cached scikit_optimize-0.8.1-py2.py3-none-any.whl (101 kB)
Collecting scipy>=1.5.2 (from chess-tuning-tools)
  Using cached scipy-1.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.5 MB)
Collecting arviz>=0.10.0 (from bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached arviz-0.15.1-py3-none-any.whl (1.6 MB)
Collecting emcee>=3.0.2 (from bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached emcee-3.1.4-py2.py3-none-any.whl (46 kB)
Collecting matplotlib>=3.3.0 (from bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached matplotlib-3.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB)
Collecting tqdm>=4.48.2 (from bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached tqdm-4.65.0-py3-none-any.whl (77 kB)
Collecting joblib>=0.11 (from scikit-learn<0.24,>=0.22->chess-tuning-tools)
  Using cached joblib-1.2.0-py3-none-any.whl (297 kB)
Collecting threadpoolctl>=2.0.0 (from scikit-learn<0.24,>=0.22->chess-tuning-tools)
  Using cached threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
Collecting pyaml>=16.9 (from scikit-optimize<0.9,>=0.8->chess-tuning-tools)
  Using cached pyaml-23.5.9-py3-none-any.whl (17 kB)
Collecting numpy>=1.19.1 (from chess-tuning-tools)
  Using cached numpy-1.25.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.7 MB)
Requirement already satisfied: setuptools>=60.0.0 in /home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages (from arviz>=0.10.0->bask<1.0.0,>=0.9.3->chess-tuning-tools) (68.0.0)
Collecting packaging (from arviz>=0.10.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached packaging-23.1-py3-none-any.whl (48 kB)
Collecting pandas>=1.3.0 (from arviz>=0.10.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached pandas-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.4 MB)
Collecting xarray>=0.21.0 (from arviz>=0.10.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached xarray-2023.5.0-py3-none-any.whl (994 kB)
Collecting h5netcdf>=1.0.2 (from arviz>=0.10.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached h5netcdf-1.2.0-py3-none-any.whl (43 kB)
Collecting typing-extensions>=4.1.0 (from arviz>=0.10.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached typing_extensions-4.6.3-py3-none-any.whl (31 kB)
Collecting xarray-einstats>=0.3 (from arviz>=0.10.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached xarray_einstats-0.5.1-py3-none-any.whl (28 kB)
Collecting contourpy>=1.0.1 (from matplotlib>=3.3.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached contourpy-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (300 kB)
Collecting cycler>=0.10 (from matplotlib>=3.3.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting fonttools>=4.22.0 (from matplotlib>=3.3.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached fonttools-4.40.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB)
Collecting kiwisolver>=1.0.1 (from matplotlib>=3.3.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached kiwisolver-1.4.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.6 MB)
Collecting pillow>=6.2.0 (from matplotlib>=3.3.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached Pillow-9.5.0-cp39-cp39-manylinux_2_28_x86_64.whl (3.4 MB)
Collecting pyparsing>=2.3.1 (from matplotlib>=3.3.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached pyparsing-3.1.0-py3-none-any.whl (102 kB)
Collecting python-dateutil>=2.7 (from matplotlib>=3.3.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting importlib-resources>=3.2.0 (from matplotlib>=3.3.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached importlib_resources-5.12.0-py3-none-any.whl (36 kB)
Collecting PyYAML (from pyaml>=16.9->scikit-optimize<0.9,>=0.8->chess-tuning-tools)
  Using cached PyYAML-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (661 kB)
Collecting h5py (from h5netcdf>=1.0.2->arviz>=0.10.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached h5py-3.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.8 MB)
Collecting zipp>=3.1.0 (from importlib-resources>=3.2.0->matplotlib>=3.3.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached zipp-3.15.0-py3-none-any.whl (6.8 kB)
Collecting pytz>=2020.1 (from pandas>=1.3.0->arviz>=0.10.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached pytz-2023.3-py2.py3-none-any.whl (502 kB)
Collecting tzdata>=2022.1 (from pandas>=1.3.0->arviz>=0.10.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached tzdata-2023.3-py2.py3-none-any.whl (341 kB)
Collecting six>=1.5 (from python-dateutil>=2.7->matplotlib>=3.3.0->bask<1.0.0,>=0.9.3->chess-tuning-tools)
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: pytz, zipp, tzdata, typing-extensions, tqdm, threadpoolctl, six, PyYAML, pyparsing, pillow, packaging, numpy, kiwisolver, joblib, fonttools, dill, cycler, Click, atomicwrites, scipy, python-dateutil, pyaml, importlib-resources, h5py, emcee, contourpy, scikit-learn, pandas, matplotlib, h5netcdf, xarray, scikit-optimize, xarray-einstats, arviz, bask, chess-tuning-tools
  Attempting uninstall: numpy
    Found existing installation: numpy 1.19.1
    Uninstalling numpy-1.19.1:
      Successfully uninstalled numpy-1.19.1
Successfully installed Click-8.0.4 PyYAML-6.0 arviz-0.15.1 atomicwrites-1.4.1 bask-0.10.8 chess-tuning-tools-0.9.3 contourpy-1.1.0 cycler-0.11.0 dill-0.3.6 emcee-3.1.4 fonttools-4.40.0 h5netcdf-1.2.0 h5py-3.9.0 importlib-resources-5.12.0 joblib-1.2.0 kiwisolver-1.4.4 matplotlib-3.7.1 numpy-1.25.0 packaging-23.1 pandas-2.0.2 pillow-9.5.0 pyaml-23.5.9 pyparsing-3.1.0 python-dateutil-2.8.2 pytz-2023.3 scikit-learn-0.23.2 scikit-optimize-0.8.1 scipy-1.10.1 six-1.16.0 threadpoolctl-3.1.0 tqdm-4.65.0 typing-extensions-4.6.3 tzdata-2023.3 xarray-2023.5.0 xarray-einstats-0.5.1 zipp-3.15.0
tune local -c simple_tune.json 
Traceback (most recent call last):
  File "/home/vivien/.pyenv/versions/3.9.17/bin/tune", line 5, in <module>
    from tune.cli import cli
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/tune/__init__.py", line 11, in <module>
    from tune.io import InitStrings, load_tuning_config, parse_ranges
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/tune/io.py", line 8, in <module>
    import skopt.space as skspace
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/skopt/__init__.py", line 44, in <module>
    from . import callbacks
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/skopt/callbacks.py", line 17, in <module>
    from skopt.utils import dump
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/skopt/utils.py", line 8, in <module>
    from sklearn.ensemble import GradientBoostingRegressor
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/sklearn/ensemble/__init__.py", line 8, in <module>
    from ._forest import RandomForestClassifier
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/sklearn/ensemble/_forest.py", line 56, in <module>
    from ..tree import (DecisionTreeClassifier, DecisionTreeRegressor,
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/sklearn/tree/__init__.py", line 6, in <module>
    from ._classes import BaseDecisionTree
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/sklearn/tree/_classes.py", line 41, in <module>
    from ._criterion import Criterion
  File "sklearn/tree/_criterion.pyx", line 1, in init sklearn.tree._criterion
  File "sklearn/tree/_splitter.pyx", line 1, in init sklearn.tree._splitter
  File "sklearn/tree/_tree.pyx", line 1, in init sklearn.tree._tree
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/sklearn/neighbors/__init__.py", line 17, in <module>
    from ._nca import NeighborhoodComponentsAnalysis
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/sklearn/neighbors/_nca.py", line 22, in <module>
    from ..decomposition import PCA
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/sklearn/decomposition/__init__.py", line 17, in <module>
    from .dict_learning import dict_learning
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/sklearn/decomposition/dict_learning.py", line 5, in <module>
    from . import _dict_learning  # type: ignore
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/sklearn/decomposition/_dict_learning.py", line 21, in <module>
    from ..linear_model import Lasso, orthogonal_mp_gram, LassoLars, Lars
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/sklearn/linear_model/__init__.py", line 11, in <module>
    from ._least_angle import (Lars, LassoLars, lars_path, lars_path_gram, LarsCV,
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/sklearn/linear_model/_least_angle.py", line 34, in <module>
    method='lar', copy_X=True, eps=np.finfo(np.float).eps,
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/numpy/__init__.py", line 313, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

why is it doing this ?

Collecting numpy>=1.19.1 (from chess-tuning-tools)
  Using cached numpy-1.25.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.7 MB)

1.25 is not even in the cache !

vivien@serv3:~/Minic/tune$ pip3 cache list
Cache contents:

 - atomicwrites-1.4.1-py2.py3-none-any.whl (6.9 kB)
 - lit-16.0.3-py3-none-any.whl (88 kB)
 - numpy-1.19.0-cp39-cp39-linux_x86_64.whl (14.0 MB)
 - numpy-1.19.1-cp39-cp39-linux_x86_64.whl (14.0 MB)
 - scikit_learn-0.23.2-cp39-cp39-linux_x86_64.whl (25.2 MB)

sorry python is hell to me :'(

@vshcherbyna
Copy link

Igel has the same problem as Minic ;)

@kiudee
Copy link
Owner

kiudee commented Jul 19, 2023

Indeed it looks like scikit-learn is incompatible with newer versions of numpy. Working on a patch that fixes the dependency specification from our side. It turned out that the old version of scikit-learn no longer builds on python 3.7 and 3.9, which is why I had to restrict chess-tuning-tools to 3.8 for now.
As soon as the upstream bayes-skopt is compatible with a newer scikit-learn, I will update this again.

@tryingsomestuff
Copy link
Author

Thanks, almost good now, still I get

2023-07-24 08:54:38,865 INFO     Computing current optimum was not successful. This can happen in rare cases and running the tuner again usually works.
Traceback (most recent call last):
  File "/home/vivien/.pyenv/versions/3.9.17/bin/tune", line 8, in <module>
    sys.exit(cli())
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/vivien/.pyenv/versions/3.9.17/lib/python3.9/site-packages/tune/cli.py", line 454, in local
    iterations=np.array(performance)[:, 0],
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

@vshcherbyna
Copy link

vshcherbyna commented Jul 24, 2023 via email

@kiudee
Copy link
Owner

kiudee commented Jul 24, 2023 via email

@tryingsomestuff
Copy link
Author

On this box I have cutechess-cli 1.2.0, it is enough ?

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

No branches or pull requests

3 participants