Open chimaerase opened 1 year ago
i've received this error as well, and I have all my dependencies up to date.
Traceback (most recent call last): File "C:\Users\david\github\beluga3\SCRATCHPAPER_6.py", line 4, in <module> from MLModule.AI.featuretoolstpot.ml_framework import MyMLModeler File "C:\Users\david\github\beluga3\MLModule\AI\featuretoolstpot\ml_framework.py", line 8, in <module> from tpot import TPOTClassifier File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\site-packages\tpot\__init__.py", line 27, in <module> from .tpot import TPOTClassifier, TPOTRegressor File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\site-packages\tpot\tpot.py", line 31, in <module> from .base import TPOTBase File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\site-packages\tpot\base.py", line 70, in <module> from .builtins import CombineDFs, StackingEstimator File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\site-packages\tpot\builtins\__init__.py", line 29, in <module> from .one_hot_encoder import OneHotEncoder, auto_select_categorical_features, _transform_selected File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\site-packages\tpot\builtins\one_hot_encoder.py", line 136, in <module> class OneHotEncoder(BaseEstimator, TransformerMixin): File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\site-packages\tpot\builtins\one_hot_encoder.py", line 216, in OneHotEncoder def __init__(self, categorical_features='auto', dtype=np.float, File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\site-packages\numpy\__init__.py", line 284, in __getattr__ raise AttributeError("module {!r} has no attribute " AttributeError: module 'numpy' has no attribute 'float'. Did you mean: 'cfloat'?
As you can see, when it tries to instantiate the class OneHotEncoder, the class has one input parameter of dtype, and it uses np.float. But apparently numpy has no such attribute. I checked all my dependencies, and made sure everything was upgrade.
I'm running Python 3.10.2
@notwopr, looks like repo permissions prevent me from linking this issue to the associated PR (#1282), but I verified the fix there just by updating the NumPY requirement.
Fixed since https://github.com/EpistasisLab/tpot/pull/1280 has been merged.
I recommend using pip install git+
to ensure that you're installing with these changes.
cc @weixuanfu with #1280 merged in, would it be possible to cut a new release of tpot
?
Context of the issue
Newer releases of Numpy (and by extension, fresh installs of TPOT) are not compatible with the latest TPOT code and
requirements.txt
. Several deprecated numpy aliases are removed in Numpy 1.24.0, and at least one (numpy.float
) is still used in the TPOT code.Process to reproduce the issue
pip install -r requirements.txt
Expected result
Successful TPOT import
Current result
AtttributeError on TPOT import
Possible fix
Document the requirement for numpy <1.24.0 until the TPOT code can be updated