Open jolespin opened 1 year ago
Dear jolespin, I had exactly the same problem, very similar model and error messages (the lines with the arrows and the last one are identical)... and tried the same things you did. Have you found out how to fix it?
At first my model was giving error messages with many repetitions of
Exception: neg_binomial_2_log_lpmf: Precision parameter is 0, but must be positive finite! (in '/Users/paulaeterovick/anaconda3/lib/python3.11/site-packages/birdman/templates/negative_binomial.stan', line 40, column 6 to column 94)
Then I tried to update the negative_binomial.stan file with the version available at https://github.com/biocore/BIRDMAn/blob/main/birdman/templates/negative_binomial.stan and got the error
13:33:16 - cmdstanpy - INFO - compiling stan file /Users/paulaeterovick/anaconda3/lib/python3.11/site-packages/birdman/templates/negative_binomial.stan to exe file /Users/paulaeterovick/anaconda3/lib/python3.11/site-packages/birdman/templates/negative_binomial 13:33:18 - cmdstanpy - WARNING - CmdStan's precompiled header (PCH) files may need to be rebuilt.Please run cmdstanpy.rebuild_cmdstan(). If the issue persists please open a bug report
And then I tried to install cmdstan like you did, I reinstalled BIRDMAn, updated Xcode, reestarted the computer, but nothing works anymore, I just get the messages you got.
I hope you found a solution. If not, I'll be happy to share if I get to solve this...
Best regards Paula
Hi @PaulaEterovick I'd recommend trying to run this on linux (@gibsramen not sure your thoughts on this, but I never got this to run on mac). The precision parameter is 0 often occurs when there is a numerical issue -- which I think can be resolved with adjusting the step_size (see the cmdstanpy docs)
I'd also double check the cmdstan / cmdstanpy versions, since there have been major breaking changes in one of the recent releases.
Hi, @mortonjt, thank you very much for the fast answer! I think I messed something up when trying to fix the first error (about the 0 parameter) and now I'm having other problems related to model compilation by Stan, so I think I need to fix this first...
I tried to update both cmdstanpy and cmdstan; I also installed cmdstanjupyter because I am using a jupyter notebook. After that I used the install_cmdstan command and I'm getting the following error:
(base) paulaeterovick@Paulas-MacBook-Pro ~ % install_cmdstan ls -F ~/.cmdstan Traceback (most recent call last): File "/Users/paulaeterovick/anaconda3/bin/install_cmdstan", line 6, in <module> from cmdstanpy.install_cmdstan import main ImportError: cannot import name 'main' from 'cmdstanpy.install_cmdstan' (/Users/paulaeterovick/anaconda3/lib/python3.11/site-packages/cmdstanpy/install_cmdstan.py) cmdstan-2.32.2/ (base) paulaeterovick@Paulas-MacBook-Pro ~ %
These are the installed versions:
(base) paulaeterovick@Paulas-MacBook-Pro ~ % conda list cmdstan packages in environment at /Users/paulaeterovick/anaconda3: Name Version Build Channel cmdstan 2.31.0 h33b0451_0 cmdstanjupyter 0.7.0 pypi_0 pypi cmdstanpy 1.1.0 pyhd8ed1ab_0 conda-forge
Do you know how to fix this?
@mortonjt thats good to know! I was trying it on Mac but I'll install it on Expanse to try again (I've had to pivot to other projects in the meantime).
Dear @mortonjt, I built a vitual machine and I'm ready to start all over in Linux. Would you be so nice to please send the the exact version of all the needed programs you used when you got to run the model in BIRDMAn? Also, what should I install with "conda" or "pip" or other command? I've heard that using different installers may also cause incompatibility problems... Thank you very much in advance
Hi, this is a @gibsramen question.
I don't think a virtual machine is a good idea : you won't have the compute required to run these models ...
Apologies if this is in the docs and I missed it but is there a resource that has benchmarking (or resource requirements) for running this on different dataset sizes?
I dont have benchmarks — and it is highly dependent on the model you use. For our ASD meta analysis, it takes about 20 min per microbe (for ~15K microbes)
On Mon, Jul 31, 2023 at 5:14 PM Josh L. Espinoza @.***> wrote:
Apologies if this is in the docs and I missed it but is there a resource that has benchmarking (or resource requirements) for running this on different dataset sizes?
— Reply to this email directly, view it on GitHub https://github.com/biocore/BIRDMAn/issues/81#issuecomment-1659171134, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA75VXLKVDGOHYKCCNPL72LXTAN2PANCNFSM6AAAAAAWBZ3YE4 . You are receiving this because you were mentioned.Message ID: @.***>
Dear all, I was able to overcome the problem in my MacOS (with help from my brother, who is a programmer) and I am sharing here what worked for me, hoping it may help @jolespin or others who need:
First of all, my PATH was leading to an older version of Python because I deleted some extra copies and one happened to be in priority (my mistake, as this is all very new to me). In order to avoid problems with several versions of programs installed in my attempts to solve the problem, we did everything directly from the basal directory (not from Anaconda). Thus, after fixing the problem with Python, we used the following commands to install the needed programs:
pip install birdman
pip install cmdstanpy
pip install --upgrade jupyter
pip install --upgrade ipywidgets
jupyter nbexternsion enable --py widgetsnbextension
pip install biom-format
jupyter lab
#to open Jupyter
(p.s. it is important to prioritize pip for installations in order to garantee compatibility among programs and appropriate paths - I may have messed it up by using different installers) My model is running now and it may take almost two days (55% after 23h)
I hope the explanation is clear and that it will help others :-)
I installed
v0.1.0
via the following:When I try to run a negative binomial model, I get the following error:
I tried installing
cmdstan
via conda but it says that it's already installed.Here's the executable I found:
I then tried running your
install_cmdstan
command but it needs an argument.