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 crashes when entering negative numbers in n_jobs #846

Closed
omarcr opened this issue Mar 12, 2019 · 4 comments
Closed

tpot crashes when entering negative numbers in n_jobs #846

omarcr opened this issue Mar 12, 2019 · 4 comments

Comments

@omarcr
Copy link

omarcr commented Mar 12, 2019

if I want to set more negative numbers than -1 the tpop pipeline returns the following:


Optimization Progress:   0%|          | 0/3030 [00:00<?, ?pipeline/s]
                                                                     
Traceback (most recent call last):
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\tpot\base.py", line 646, in fit
    per_generation_function=self._check_periodic_pipeline
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\tpot\gp_deap.py", line 227, in eaMuPlusLambda
    population = toolbox.evaluate(population)
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\tpot\base.py", line 1277, in _evaluate_individuals
    ind.fitness.values = (self.evaluated_individuals_[ind_str]['operator_count'],
KeyError: 'KNeighborsClassifier(input_matrix, KNeighborsClassifier__n_neighbors=62, KNeighborsClassifier__p=2, KNeighborsClassifier__weights=distance)'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\IPython\core\interactiveshell.py", line 3291, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-474670f1801d>", line 1, in <module>
    runfile('C:/Users/Omar/OneDrive - Massachusetts Institute of Technology/decoding/2019 for motion color modelling/tpot_optima.py', wdir='C:/Users/Omar/OneDrive - Massachusetts Institute of Technology/decoding/2019 for motion color modelling')
  File "C:\Program Files\JetBrains\PyCharm 2018.3.5\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm 2018.3.5\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:/Users/Omar/OneDrive - Massachusetts Institute of Technology/decoding/2019 for motion color modelling/tpot_optima.py", line 171, in <module>
    pipeline_optimizer.fit(X_train, y_train)
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\tpot\base.py", line 678, in fit
    raise e
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\tpot\base.py", line 669, in fit
    self._update_top_pipeline()
  File "C:\Users\Omar\AppData\Local\conda\conda\envs\tensor19\lib\site-packages\tpot\base.py", line 743, in _update_top_pipeline
    raise RuntimeError('A pipeline has not yet been optimized. Please call fit() first.')
RuntimeError: A pipeline has not yet been optimized. Please call fit() first.


@weixuanfu
Copy link
Contributor

The n_jobs parameter should only be a positive integer or -1.

@omarcr
Copy link
Author

omarcr commented Mar 12, 2019

why not less than -1? this implies that I want to reserve some CPUs for general use and the other ones used in parallel here

@weixuanfu
Copy link
Contributor

Hmm, I think it is a good option, which is similar with n_jobs in scikit-learn. We will add this option into next version of TPOT.

weixuanfu added a commit to weixuanfu/tpot that referenced this issue Apr 11, 2019
This was referenced Apr 11, 2019
@weixuanfu
Copy link
Contributor

I close this issue because it is fixed in master branch. Please feel free to reopen it if there is other related issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants