美文网首页
PyMC3 兼容性问题解决

PyMC3 兼容性问题解决

作者: 青云直上 | 来源:发表于2022-05-01 14:24 被阅读0次

PyMC3是python里做贝叶斯分析的一个包,这个包还依赖于Theano。而在最新的3.10.0版本的PyMC3与Theano之间有严重的兼容性问题。比如import的时候会遇到以下问题

ImportError: cannot import name 'is_same_graph'

建议把PyMC3和Theano都卸载掉,重新以兼容性好的版本安装。

pip install pymc3==3.8.0
pip install theano == 1.0.5

再试一下,问题仍然没有解决!网上找了很多文章都过时了!

最后还是去官方Github,
Installation Guide (MacOS) · pymc-devs/pymc Wiki · GitHub

新款mac new M1 chip

conda create -c conda-forge -n pymc3_env python=3.9 pymc3
conda activate pymc3_env

旧款mac (Intel) Macs:

conda create -c conda-forge -n pymc3_env python=3.9 pymc3 theano-pymc mkl mkl-service
conda activate pymc3_env

Note that you must specifically request theano-pymc or you will get an obsolete version of PyMC3 that works with the now-abandoned theano library. We encourage you to test this with the --dry-run flag to ensure you get up-to-date versions.

相关文章

网友评论

      本文标题:PyMC3 兼容性问题解决

      本文链接:https://www.haomeiwen.com/subject/hshpyrtx.html