没有名为“tensorflow_probability"的模块 [英] No module named 'tensorflow_probability'
问题描述
我需要使用 Tensorflow 和 Tensorflow_Probability.通过以下命令安装后: conda install tensorflow-probability
或 pip install --upgrade tensorflow-probability
,我在笔记本中运行它:
I need to use Tensorflow and Tensorflow_Probability. After installing it by these commands: conda install tensorflow-probability
or pip install --upgrade tensorflow-probability
, I ran it in the notebook:
import tensorflow_probability as tfp
但它返回此错误:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-8-41494c8c96ff> in <module>
----> 1 import tensorflow_probability as tfp
ModuleNotFoundError: No module named 'tensorflow_probability'.
结果
pip list
如下(相关部分):
tblib 1.3.2
tensorboard 1.13.1
tensorflow 1.13.1
tensorflow-estimator 1.13.0
tensorflow-probability 0.7.0
termcolor 1.1.0
terminado 0.8.1
testpath 0.4.2
tfp-nightly 0.8.0.dev20190708
Theano 1.0.4
toolz 0.9.0
谁能帮我解决这个问题(我使用的是 Win 10)?
Can anyone help me to solve this problem (I am using Win 10)?
推荐答案
你的版本是正确的,你的命令也是正确的.
Your versions are correct and your command is correct too.
似乎是其他模块的不一致导致了这种情况.
Seems like inconsistency in other module is causing this.
运行以下命令并重试:
pip install -U dm-sonnet==1.23
pip install --upgrade tfp-nightly
参考资料:https://github.com/deepmind/graph_nets/issues/3https://github.com/tensorflow/probability/issues/103
这篇关于没有名为“tensorflow_probability"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!