gpt4 book ai didi

python - tensorflow安装问题

转载 作者:太空狗 更新时间:2023-10-29 17:27:19 25 4
gpt4 key购买 nike

我尝试在我的 ubuntu 14.04 64 位机器上安装 tensorflow:

sudo pip2 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.6.0-cp27-none-linux_x86_64.whl

对于 python 2.7

当我在控制台中运行 import tensorflow as tf 时出现错误

Error importing tensorflow. Unless you are using bazel, you should not try to import tensorflow from its source directory; please exit the tensorflow source tree, and relaunch your python interpreter from there.

Google 对此没有提供好的答案,有什么想法吗?

最佳答案

当您在 tensorflow 源目录中时,您无法导入 tensorflow。在运行 python 之前先更改目录,即 cd ..

我已经强调了错误的关键部分:“导入 tensorflow 时出错。除非您使用的是 bazel,否则您不应尝试从其源目录导入 tensorflow;请退出 tensorflow 源代码树,然后从那里重新启动你的 python 解释器。”

关于python - tensorflow安装问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35252888/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com