scikit-learn version warning

This is my first week using Qiime2 therefore apologies for any basic questions. Could you please look into this error, which is the opposite of the above mentioned error? I am running Qiime2 on a supercomputer. How can I fix this?

[email protected] [~/rawdata/16srna/shi7_learning/fastqs_stitched] % qiime feature-classifier classify-sklearn \

–i-classifier …/databases/silva-132-99-515-806-nb-classifier.qza
–i-reads dada2-single-end-rep-seqs.qza
–o-classification taxonomy-single-end.qza

Plugin error from feature-classifier:

The scikit-learn version (0.21.2) used to generate this artifact does not match the current version of scikit-learn installed (0.20.2). Please retrain your classifier for your current deployment to prevent data-corruption errors.

Hi @Irshad!

The scikit-learn version (0.21.2) used to generate this artifact does not match the current version of scikit-learn installed (0.20.2).

Scikit-learn requires you to use a classifier that was trained with the same version as scikit-learn that you’re using to run your command. This protects your analysis from unexpected behavior. If you are using a pre-trained classifier from the QIIME 2 docs, make sure that the version of QIIME 2 you’re using is the same as the version of the docs you downloaded your classifier from.

qiime info will let you get the version of QIIME 2 you’re using, and you can get the correct version of the docs by using the correct version number in this URL:{version-number}/data-resources/

For example:

Even better, ask your sysadmin to install the latest version of QIIME 2, and then you can use the classifier from the current docs. :slight_smile:


1 Like

I have the exact same problem! Except mine says I have scikit-learn version 0.19.1. Based on this post, I downloaded an older version of the classifier from here, but it still gives the same error! Maybe you can try and let me know if this worked for you?

I updated sklearn to the latest version manually, but qiime doesn’t use it because it has it’s own sklearn version within its environment. So at this point apart form upgrading qiime2 and the virtual box, I don’t know what to do. I would appreciate any help!

@kmz, are you mixing up your scikit-learn version with your qiime2 version?

Edit: sciki-learn version 0.19.1 is pretty old. What version of QIIME 2 are you using? You might want to upgrade to the latest. There have been many improvements in the last couple years, including some that might save you days of run time.

1 Like

@ChrisKeefe You are absolutely correct. I thought I had to match the sklearn version and not the qiime2 version! Now I downloaded the correct version and I’m running the code again, and no errors so far.

Thank you!

My qiime version is 2018.11. I will upgrade it since you think it’s better to do so. I’m always a little hesitant to upgrade unfortunately.

1 Like

Hi Chris,

Thank you for the insight. I think the best would be to ask the system admin for an upgrade to the latest version as it would improve the overall performance i.e. time to execute a job (as you mentioned in your answer to @kmz question ). I have requested for an upgrade which should be accepted.
I got the current classifier from a collaborator and would prefer not to change it.


Glad to hear that worked for you, @kmz. There’s always a little risk in software upgrades, but we have a pretty good track record so far. :slightly_smiling_face: Backward compatability is generally a priority, and changes are published every release, so you can spot workflow-breaking changes before you make the leap to a new version.


Sounds like a plan, @Irshad. Do note that upgrading QIIME 2 to a new version won’t upgrade your classifier, so if your classifier wasn’t built with the newer version your sysadmin installs, you could still have a mismatch. I know this sounds pedantic, but people make this mistake all the time.

If you need to confirm what version was used to build your classifier, you can open the classifier with q2view, click over to the “provenance” tab at the top right, and click on the bottom box in the graph to get the classifier’s version (and other provenance info). Good luck!

1 Like

A post was split to a new topic: kill error on classify-sklearn

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.