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

TPOT report error #1341

Closed
sch401 opened this issue Jan 27, 2024 · 4 comments
Closed

TPOT report error #1341

sch401 opened this issue Jan 27, 2024 · 4 comments
Assignees

Comments

@sch401
Copy link

sch401 commented Jan 27, 2024

Today when I ran a machine learning project using TPOT, it reported the error below:

D:\rebirth - default\venv_test\Lib\site-packages\tpot\builtins\__init__.py:36: UserWarning: Warning: optional dependency `torch` is not available. 
- skipping import of NN models.
  warnings.warn("Warning: optional dependency `torch` is not available. - skipping import of NN models.")

Generation 1 - Current best internal CV score: -inf
Traceback (most recent call last):
  File "D:\rebirth - default\venv_test\Lib\site-packages\tpot\base.py", line 817, in fit
    self._pop, _ = eaMuPlusLambda(
                   ^^^^^^^^^^^^^^^
  File "D:\rebirth - default\venv_test\Lib\site-packages\tpot\gp_deap.py", line 285, in eaMuPlusLambda
    per_generation_function(gen)
  File "D:\rebirth - default\venv_test\Lib\site-packages\tpot\base.py", line 1183, in _check_periodic_pipeline
    self._update_top_pipeline()
  File "D:\rebirth - default\venv_test\Lib\site-packages\tpot\base.py", line 935, in _update_top_pipeline
    raise RuntimeError(
RuntimeError: There was an error in the TPOT optimization process. This could be because the data was not formatted properly, or because data for a regression problem was provided to the TPOTClassifier object. Please make sure you passed the data to TPOT correctly. If you enabled PyTorch estimators, please check the data requirements in the online documentation: https://epistasislab.github.io/tpot/using/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "d:\rebirth - default\tpot优化.py", line 169, in <module>
    tpot.fit(training_features, training_target)
  File "D:\rebirth - default\venv_test\Lib\site-packages\tpot\base.py", line 864, in fit
    raise e
  File "D:\rebirth - default\venv_test\Lib\site-packages\tpot\base.py", line 855, in fit
    self._update_top_pipeline()
  File "D:\rebirth - default\venv_test\Lib\site-packages\tpot\base.py", line 935, in _update_top_pipeline
    raise RuntimeError(
RuntimeError: There was an error in the TPOT optimization process. This could be because the data was not formatted properly, or because data for a regression problem was provided to the TPOTClassifier object. Please make sure you passed the data to TPOT correctly. If you enabled PyTorch estimators, please check the data requirements in the online documentation: https://epistasislab.github.io/tpot/using/

The code was successfully ran three months ago. But I updated the python libraries last week. I guess some updated libraries resulted in this error.

@miguelehernandez
Copy link

Assigned to Nick to keep visibility on the issue. Nick to take a look and decide if it needs to be assigned to someone else in the team.

@yradwan147
Copy link

I can confirm this. When I tried to run on my local machine using a fresh conda environment on Python 3.10.13, the code gave me the above error. However, when I ran it on a Kaggle environment, it worked.

After checking around, I tried reinstalling dependencies on my local environment with the versions on the kaggle environment and it worked locally.

These are the versions that worked for me:

pandas==2.2.0 numpy==1.24.4 matplotlib==3.7.4 seaborn==0.12.2 scikit-learn==1.2.2 scipy==1.11.4 TPOT==0.12.1 gplearn==0.4.2 torch==2.1.2 termcolor==2.4.0 sympy==1.12

@perib
Copy link
Contributor

perib commented Apr 22, 2024

Has the latest update resolved your issue? Should be working with the latest version of scikit-learn now

@sch401
Copy link
Author

sch401 commented Apr 23, 2024

It has been solved. Thank you. :)

@perib perib closed this as completed Apr 23, 2024
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

6 participants