简体   繁体   English

导入 tensorflow 概率的问题

[英]problem with importing tensorflow probability

I am using Anaconda and Ubuntu 18.04.我正在使用 Anaconda 和 Ubuntu 18.04。 I installed TensorFlow probability base on Anaconda's command:我根据 Anaconda 的命令安装了 TensorFlow 概率:

 conda install -c conda-forge tensorflow-probability 

but when I wanted to import TensorFlow probability, I faced with below error:但是当我想导入 TensorFlow 概率时,我遇到了以下错误:

ImportError: cannot import name 'compiler' from 'tensorflow.python.autograph.pyct' (/home/alireza/anaconda3/envs/tf-gpu/lib/python3.8/site-packages/tensorflow/python/autograph/pyct/ init .py) ImportError:无法从“tensorflow.python.autograph.pyct”(/home/alireza/anaconda3/envs/tf-gpu/lib/python3.8/site-packages/tensorflow/python/autograph/pyct/)导入名称“compiler”初始化.py)

I check Anaconda by conda list tensorflow and TensorFlow probability version 0.8 was installed.我通过 conda list tensorflow 和 TensorFlow 概率版本 0.8 检查 Anaconda。

I appreciate your suggestion.我很欣赏你的建议。

I think it's been a long time since the conda recipe for TFP was updated (TFP is now at 0.12), so you would need to ensure the version of TensorFlow you have is compatible.我认为 TFP 的 conda 配方更新已经很长时间了(TFP 现在是 0.12),所以你需要确保你拥有的 TensorFlow 的版本是兼容的。 FWIW from the 0.8 release notes: "It is tested and stable against TensorFlow version 2.0.0 and 1.15.0rc1."来自 0.8 发行说明的 FWIW:“它针对 TensorFlow 版本 2.0.0 和 1.15.0rc1 进行了测试并且稳定。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM