JSONDecondeError during sklearn with naive bayes

I'm using qiime2 in conda and the size of the memory allocated is 7.7gb with 6.5gb free memory. During the training of sklearn classifier with the naive bayes model, i into some issues i cannot handle. Here are the code, db files and error messages.

Code:
qiime feature-classifier fit-classifier-sklearn
--i-reference-reads silva_ref_seqs.qza
--i-reference-taxonomy taxonomy.qza
--o-classifier classifier_silva_naive_bayes.qza
--p-classifier-specification "naive-bayes"

DB files:
SILVA_138.2_SSURef_NR99_tax_silva.fasta
tax_slv_ssu_138.2.txt

Error messages:
Plugin error from feature-classifier:

Expecting value: line 1 column 1 (char 0)

See above for debug info.

Detailed error:
/home/jaesik/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_feature_classifier/classifier.py:106: UserWarning: The TaxonomicClassifier artifact that results from this method was trained using scikit-learn version 1.5.2. 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)
Traceback (most recent call last):
File "/home/jaesik/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2cli/commands.py", line 520, in call
results = self._execute_action(
File "/home/jaesik/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2cli/commands.py", line 581, in _execute_action
results = action(**arguments)
File "", line 2, in fit_classifier_sklearn
File "/home/jaesik/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py", line 342, in bound_callable
outputs = self.callable_executor(
File "/home/jaesik/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py", line 576, in callable_executor
output_views = self._callable(**view_args)
File "/home/jaesik/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_feature_classifier/classifier.py", line 135, in fit_classifier_sklearn
spec = json.loads(classifier_specification)
File "/home/jaesik/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/home/jaesik/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/jaesik/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Hello @Jaesik,

Welcome to the forums! :qiime2:

Thank you for posting the full error. While this error is about decoding, I suspect the real issue is a lack of free memory.

This is enough for most Qiime2 plugins, but not training a SKL classifier.
(Training a classifier just needs a lot of memory!)

Instead, try downloading a ready-to-use classifier here!
The memory-intensive training has already been performed on all of these! :point_down:

Thank you for your nice and kind reply

I have already completed the classification with the pre-trained classifier, but i was to try to train the sklearn classifier with both silva AND greengeens.

However the graph you showed seems to say the training cannot be executed with the normal personal computer :smiling_face_with_tear:

Thank you

Like, at the same time, in order to combine them? :arrow_forward: :arrow_backward:

Yeah, training takes a lot of memory right now.

Other methods don't need as much memory and some don't need pre-training at all!
https://docs.qiime2.org/2024.5/plugins/available/feature-classifier/

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