python - 我无法导入 tensorflow-gpu

标签 python python-3.x tensorflow

我已经成功安装了 tensorflow pip install tensorflow并且一切都按预期进行。
我也可以使用 pip install tensorflow-gpu 成功安装 tensorflow-gpu但我无法在我的 python 脚本中导入它:

import tensorflow-gpu

File "<stdin>", line 1
import tensorflow-gpu
                 ^
SyntaxError: invalid syntax
我已经安装了 CUDA v9.0 并运行了 Windows 10

最佳答案

pypi 上的包称为 tensorflow-gpu 但您只需使用“tensorflow”导入它

 import tensorflow as tf

关于python - 我无法导入 tensorflow-gpu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53801766/

相关文章:

python - super 集仪表板 - 动态更新

python - 如何在变量名中使用 '-'减号进行查询和打印

r - 在 R 上安装 TensorFlow

python - 有状态 LSTM 和流预测

python - DiscordPy 扩展 'cogs.economy' 引发错误 : TypeError: object NoneType can't be used in 'await' expression

python - 如何在 Django channel 消费者中访问 URL 参数

python - 根据列中的值是整数(整数)的条件过滤数据框

python - 我有一个用 Julia 编写的高性能函数,如何从 Python 中使用它?

python-3.x - 将 aiohttp 请求与其响应相关联

python - Tensorflow 对象检测 API 裁剪图像片段