# fit-classifier-naive-bayes error

**URL:** https://forum.qiime2.org/t/fit-classifier-naive-bayes-error/26503
**Category:** User Support
**Created:** [May 18, 2023, 1:11pm UTC](https://forum.qiime2.org/t/fit-classifier-naive-bayes-error/26503 "2023-05-18T13:11:25Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![eDNA](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/e/dec6dc/32.png) [@eDNA](https://forum.qiime2.org/u/eDNA)
#### Post date: [May 18, 2023, 1:11pm UTC](https://forum.qiime2.org/t/fit-classifier-naive-bayes-error/26503/1 "2023-05-18T13:11:25Z")

</div>

Hello, I downloaded the database for CO1 from MIDORI 2 ([Download](http://www.reference-midori.info/download.php)).  
I unzipped the files, imported into QIIME2-2023.2. I run below command in my mac, and it did not work.

```auto
qiime feature-classifier fit-classifier-naive-bayes \
--i-reference-reads MIDORI2_UNIQ_NUC_SP_GB255_CO1_QIIME.qza \
--i-reference-taxonomy MIDORI2_UNIQ_NUC_SP_GB255_CO1_QIIME.taxon.qza \
--verbose \
--o-classifier CO1_classifier.qza

```

**/miniconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2\_feature\_classifier/classifier.py:102: UserWarning: The TaxonomicClassifier artifact that results from this method was trained using scikit-learn version 0.24.1. It cannot be used with other versions of scikit-learn. (While the classifier may complete successfully, the results will be unreliable.)**

**warnings.warn(warning, UserWarning)**

**zsh: killed qiime feature-classifier fit-classifier-naive-bayes --i-reference-reads**

I also run the same command in a server and got below error message:  
**Plugin error from feature-classifier:**  
U**nable to allocate 120. GiB for an array with shape (20000, 807796) and data type int64**  
\*\*\*\*Deb **ug info has been saved to /tmp/qiime2-q2cli-err-djk90mzh.log**

I was wondering what the warning message means and how I can train the classifier properly.

---

<div class="post-metadata">

### Author: ![cherman2](https://forum.qiime2.org/user_avatar/forum.qiime2.org/cherman2/32/17129_2.png) [@cherman2](https://forum.qiime2.org/u/cherman2)
#### Post date: [May 18, 2023, 2:53pm UTC](https://forum.qiime2.org/t/fit-classifier-naive-bayes-error/26503/2 "2023-05-18T14:53:21Z")

</div>

Hi @eDNA,  
This error is saying that you do not have enough memory to run this command. It takes a lot of memory to train a classifier!

Do you know how much RAM is available on your MAC? Do you have access to an HPC because that might be necessary to run this command?

---

<div class="post-metadata">

### Author: ![eDNA](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/e/dec6dc/32.png) [@eDNA](https://forum.qiime2.org/u/eDNA)
#### Post date: [May 18, 2023, 3:12pm UTC](https://forum.qiime2.org/t/fit-classifier-naive-bayes-error/26503/3 "2023-05-18T15:12:36Z")

</div>

The memory on my mac is 16GB.

The number of sequences in the MIDORI2\_UNIQ\_NUC\_SP\_GB255\_CO1\_QIIME.qza file is 2809132.

How much memory is needed? Yes, I have access to an HPC and a server.  
When I run the command in a server, I set

```auto
#SBATCH --mem=120G
#SBATCH --cpus-per-task=32

```

I got the error I mentioned in the post.

---

<div class="post-metadata">

### Author: ![cherman2](https://forum.qiime2.org/user_avatar/forum.qiime2.org/cherman2/32/17129_2.png) [@cherman2](https://forum.qiime2.org/u/cherman2)
#### Post date: [May 18, 2023, 3:36pm UTC](https://forum.qiime2.org/t/fit-classifier-naive-bayes-error/26503/4 "2023-05-18T15:36:42Z")

</div>

Hi @eDNA,  
It looks like you will need more than 120G of memory!

> [@eDNA](#):
>
> `#SBATCH --mem=120G`

I can't predict the exact amount of memory you will need.

However, This task doesn't have the option for multi-threading so I think this isn't doing anything helpful.

> [@eDNA](#):
>
> `#SBATCH --cpus-per-task=32`

Hope that helps!  
🐢

---

<div class="post-metadata">

### Author: ![cherman2](https://forum.qiime2.org/user_avatar/forum.qiime2.org/cherman2/32/17129_2.png) [@cherman2](https://forum.qiime2.org/u/cherman2)
#### Post date: [May 18, 2023, 7:35pm UTC](https://forum.qiime2.org/t/fit-classifier-naive-bayes-error/26503/7 "2023-05-18T19:35:36Z")

</div>

Hi again @eDNA,  
Another moderator chimed in with some helpful advice!  
Have you dereplicated your reference database? Here is the [rescript tutorial](https://forum.qiime2.org/t/processing-filtering-and-evaluating-the-silva-database-and-other-reference-sequence-data-with-rescript/15494) that may be helpful with that.

You could also skip the classifier and run `feature-classifier classify-consensus-blast` or `feature-classifier classify-consensus-vsearch`. For this you may want to consider setting either `--p-maxaccepts 32 --p-maxrejects 128` or `--p-maxaccepts 64 --p-maxrejects 256` as opposed to performing an exhaustive search.

Hope that helps!  
🐢

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [June 19, 2023, 1:35am UTC](https://forum.qiime2.org/t/fit-classifier-naive-bayes-error/26503/8 "2023-06-19T01:35:54Z")

</div>

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