aimclub / FEDOT

Automated modeling and machine learning framework FEDOT
https://fedot.readthedocs.io
BSD 3-Clause "New" or "Revised" License
627 stars 86 forks source link

error while importing "from fedot.api.main import Fedot" #353

Closed hemangjoshi37a closed 1 year ago

hemangjoshi37a commented 3 years ago

import line : from fedot.api.main import Fedot

Error :

ValueError Traceback (most recent call last)

in ----> 1 from fedot.api.main import Fedot 2 3 #task selection, initialisation of the framework 4 baseline_model = Fedot(problem='classification') 5 /usr/local/lib/python3.9/dist-packages/fedot/api/main.py in 13 from fedot.core.data.visualisation import plot_forecast 14 from fedot.core.log import default_log ---> 15 from fedot.core.optimisers.utils.pareto import ParetoFront 16 from fedot.core.pipelines.node import PrimaryNode 17 from fedot.core.pipelines.pipeline import Pipeline /usr/local/lib/python3.9/dist-packages/fedot/core/optimisers/utils/pareto.py in 3 from deap.tools import ParetoFront as DeapParetoFront 4 ----> 5 from fedot.core.visualisation.opt_viz import PipelineEvolutionVisualiser 6 7 /usr/local/lib/python3.9/dist-packages/fedot/core/visualisation/opt_viz.py in 9 import numpy as np 10 import pandas as pd ---> 11 import seaborn as sns 12 from PIL import Image 13 from deap import tools ~/.local/lib/python3.9/site-packages/seaborn/__init__.py in 7 from .utils import * 8 from .palettes import * ----> 9 from .relational import * 10 from .regression import * 11 from .categorical import * ~/.local/lib/python3.9/site-packages/seaborn/relational.py in 16 from .algorithms import bootstrap 17 from .palettes import color_palette, cubehelix_palette, _parse_cubehelix_args ---> 18 from .axisgrid import FacetGrid, _facet_docs 19 20 ~/.local/lib/python3.9/site-packages/seaborn/axisgrid.py in 14 from .palettes import color_palette, blend_palette 15 from .external.six import string_types ---> 16 from .distributions import distplot, kdeplot, _freedman_diaconis_bins 17 18 ~/.local/lib/python3.9/site-packages/seaborn/distributions.py in 14 15 try: ---> 16 import statsmodels.nonparametric.api as smnp 17 _has_statsmodels = True 18 except ImportError: ~/.local/lib/python3.9/site-packages/statsmodels/nonparametric/api.py in 5 "lowess", "bandwidths" 6 ] ----> 7 from .kde import KDEUnivariate 8 from .smoothers_lowess import lowess 9 from . import bandwidths ~/.local/lib/python3.9/site-packages/statsmodels/nonparametric/kde.py in 21 from . import bandwidths 22 from .kdetools import forrt, revrt, silverman_transform ---> 23 from .linbin import fast_linbin 24 25 # Kernels Switch for estimators statsmodels/nonparametric/linbin.pyx in init statsmodels.nonparametric.linbin() ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
J3FALL commented 3 years ago

Greetings, @hemangjoshi37a! Looks like the problem occurs due to some version conflicts with external libraries (probably, seaborn). Unfortunately, it is not clear how to reproduce this. It would be useful if you provide more details of your environment:

You can provide your venv configuration or docker-image where it can be reproduced. Thank you!

hemangjoshi37a commented 3 years ago

Python Version : 3.8.6 (64bit) Fedot Version : 0.3.1 (Installed using pip)

Required by Fedot 0.3.1 Versions :

scikit-optimize==0.7.4
pandas==1.1.0
statsmodels==0.12.0
dataclasses==0.7; python_version < '3.7'
ete3==3.1.1
numpy==1.19.2
pytest==6.2.3
anytree==2.8.0
typing==3.7.4.1
scikit_learn==0.24.1
matplotlib==3.0.2; python_version < '3.8'
matplotlib==3.3.1; python_version == '3.8'
networkx==2.4
xgboost==1.0.1
Pillow==8.2.0
imageio==2.8.0
seaborn==0.9.0
hyperopt==0.2.4
joblib==0.17.0
tensorflow==2.2.0; python_version <= '3.7'
tensorflow==2.5.0; python_version == '3.8'
nltk==3.5
SALib==1.3.11
deap==1.3.1
lightgbm==2.3.1
catboost==0.25.1

Available in my PC Versions :

absl-py==0.13.0
anytree==2.8.0
astunparse==1.6.3
attrs==21.2.0
cachetools==4.2.2
certifi==2021.5.30
chardet==4.0.0
click==8.0.1
cloudpickle==1.6.0
cycler==0.10.0
deap==1.3.1
decorator==5.0.9
ete3==3.1.1
fedot==0.3.1
flatbuffers==1.12
future==0.18.2
gast==0.4.0
google-auth==1.32.1
google-auth-oauthlib==0.4.4
google-pasta==0.2.0
grpcio==1.34.1
h5py==3.1.0
hyperopt==0.2.4
idna==2.10
imageio==2.8.0
iniconfig==1.1.1
joblib==0.17.0
keras-nightly==2.5.0.dev2021032900
Keras-Preprocessing==1.1.2
kiwisolver==1.3.1
Markdown==3.3.4
matplotlib==3.3.1
networkx==2.4
nltk==3.5
numpy==1.19.2
oauthlib==3.1.1
opt-einsum==3.3.0
packaging==21.0
pandas==1.1.0
patsy==0.5.1
Pillow==8.1.1
pluggy==0.13.1
protobuf==3.17.3
py==1.10.0
pyaml==20.4.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pyparsing==2.4.7
pytest==6.2.3
python-dateutil==2.8.1
pytz==2021.1
PyYAML==5.4.1
regex==2021.7.6
requests==2.25.1
requests-oauthlib==1.3.0
rsa==4.7.2
SALib==1.3.11
scikit-learn==0.24.1
scikit-optimize==0.7.4
scipy==1.7.0
seaborn==0.9.0
six==1.16.0
statsmodels==0.12.0
tensorboard==2.5.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.0
tensorflow==2.5.0
tensorflow-estimator==2.5.0
termcolor==1.1.0
threadpoolctl==2.1.0
toml==0.10.2
tqdm==4.61.2
typing==3.7.4.1
typing-extensions==3.7.4.3
urllib3==1.26.6
Werkzeug==2.0.1
wrapt==1.12.1
xgboost==1.0.1

Full Script Download - HTML Full Script Download - Jupyter Notebook

nicl-nno commented 3 years ago

Thank you for the details.

Python Version : 3.8.6 (64bit)

From the provided logs, it looks like the errors in your notebook are related to Python 3.9.

image

Also, the class names are similar to the GitHub master version, not the 0.3.1 from PyPI (for example "from fedot.core.pipelines.pipeline import Pipeline" was "from fedot.core.chains.chain import Chain" is 0.3.1)

So, can you check that kernel that is used to run the notebook?

hemangjoshi37a commented 3 years ago

@nicl-nno Thank you for the response sir.

I have set my kernel version to 3.8.6 (64bit) but the notebook keeps importing from python 3.9 libraries. I don't know why does that happen? Screenshot from 2021-07-07 15-07-34

And I dont exactly remember whether I have installed Fedot from master branch or from pypi.

hemangjoshi37a commented 3 years ago

Actually it would be great to support python3.9 because I see that it is very well adopted version.

hemangjoshi37a commented 3 years ago

Also as you can see here that by installing Fedot from PyPI it gets stuck at "Building wheel for pandas (PEP517)" Screenshot from 2021-07-07 22-48-51

J3FALL commented 3 years ago

Ok, thanks! Looks like some of the libraries are not well suitable for python 3.9 (pandas and SALib, for instance).

We will discuss it with the team and probably adapt fedot for python 3.9 soon.

hemangjoshi37a commented 3 years ago

Still cant install in python3.9. Hope to see the dependencies resolved soon.

nicl-nno commented 2 years ago

We refactored the requirements in the current master version to make it compatible Python 3.9. Is it works for you now? The release with this updates is coming soon.

nicl-nno commented 1 year ago

The support for 3.9 added.