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.