MICOM ERROR:All numerical optimizations failed. This indicates a problem with the solver or numerical instabilities. Check that you have CPLEX or Gurobi installed. You may also increase the abundance cutoff to create simpler models.

Hi.. First I would like to thank you for providing such an amazing tool! I am new to computational studies and also to MICOM, so I am sorry in advance if this question is not makes much sense
When I use grow function I encounter with the error of:
"All numerical optimizations failed. This indicates a problem with the solver or numerical instabilities. Check that you have CPLEX or Gurobi installed. You may also increase the abundance cutoff to create simpler models."

from micom.workflows import grow
from micom.workflows import grow
from micom.qiime_formats import load_qiime_medium

data=pd.read_excel('data.xlsx')
print(data)
agora_data_try = pd.read_csv('meta.tsv', sep='\t')
manifest = build(data, out_folder="/home/dgenc/new_env/models", model_db='agora103_genus.qza', cutoff=0.000001, threads=8,solver='cplex')
print(manifest)
medium = load_qiime_medium("western_diet_gut.qza")
print(medium)
res = grow(manifest, model_folder="models", medium=medium, tradeoff=0.5, threads=8, presolve=True)
print(res)

If I am able to pass this error, then I get the following error:
This can often be fixed by enabling presolve, choosing more permissive atol and rtol arguments, or by checking that medium fluxes are > atol.

Thank you so much for you help!!

Did you ever get help for this issue? I get this same error for qiime micom tradeoff. I used a cutoff of 0.0001, which seemed to get pretty good coverage in the models:
Community models cover 52.52%-95.01% of the total abundance (average 81.00%+-7.00%).

qiime micom build --i-abundance Data-6m.qza --i-taxonomy Data-gtdb-214_1_taxonomy.qza --i-models agora201_gtdb207_genus_1.qza --p-cutoff 0.0001 --p-threads 32 --o-community-models micom-models-gtdb-6m.qza --verbose

qiime micom tradeoff --i-models micom-models-gtdb-6m.qza --i-medium western_diet_gut.qza --p-threads 32 --o-results micom-tradeoff-gtdb-6m.qza --verbose

OptimizationError: All numerical optimizations failed. This indicates a problem with the solver or numerical instabilities. Check that you have CPLEX or Gurobi installed. You may also increase the abundance cutoff in qiime micom build to create simpler models or choose a more permissive solver tolerance.

I don't understand how to change the solver tolerance. I see two options related to tolerance - atol & rtol, but I don't see any help on how to change those. @cdiener

Sorry for the late reply. Somehow did not see the notifications.

Everything looks good here for both of you, so hard to say what is going on without havviong the data at hand. Since you are using CPLEX: you do have a license for it setup, correct? Sometimes those errors will be observed when only installing the community version of CPLEX because that will error out because the models exceed the size limitation.

Updating MICOM might also help. To diagnose better it can also be helpful to run qiime micom tradeoff with only a single thread until hitting the first error. That should fail pretty quickly and the error message will be much more informative.

Hello!
I was trying to use MICOM with my own microbiota sequencing data following the community tutorial and I always got an error when running the qiime micom tradeoff function.

  All numerical optimizations failed. This indicates a problem with the solver or numerical instabilities. Check that you have CPLEX or Gurobi installed. You may also increase the abundance cutoff in `qiime micom build` to create simpler models or choose a more permissive solver tolerance.

I thought that It could be a problem related to my dataset, so I tried with the exact same datasets from the community tutorial and everyting works fine until the same step, when I recieve the same error, together with the following error for all samples:

Read LP format model from file /tmp/tmpc9em8l_6.lp
Reading time = 0.39 seconds
: 54933 rows, 161429 columns, 662527 nonzeros
[03/19/25 16:39:24] ERROR    Sample ERR1883207 could not be       tradeoff.py:29
                             optimized (None).

I have Gurobi correctely installed and with a full academic license.

I would really appreciate any help to try to solve this problem.

Many thanks in advance

This is the code that I am using:

qiime micom build --i-abundance cdi_table.qza \
                  --i-taxonomy cdi_taxa.qza \
                  --i-models agora103_refseq216_genus_1.qza \
                  --p-cutoff 0.0001 \
                  --p-threads 4 \
                  --o-community-models models_cdi.qza \
                  --verbose

qiime micom tradeoff --i-models models_cdi.qza \
                     --i-medium western_diet_gut_agora.qza \
                     --p-threads 4 \
                     --o-results tradeoff_cdi.qza \
                     --verbose

qiime micom plot-tradeoff --i-results tradeoff_cdi.qza \
                          --o-visualization tradeoff_cdi.qzv

@cdiener

Hi,

If you run it with --p-threads 1 you should get a more informative error message. Are you using Gurobi 12.0 by any chance? In that case you migth have to update optlang to version 1.8.3 in your environment.