gpt4 book ai didi

python - 安装了tensorflow,但是pycharm忽略了它

转载 作者:太空宇宙 更新时间:2023-11-04 06:49:55 24 4
gpt4 key购买 nike

我通过(Joshua 的回答)安装了 tensorflow: how to install tensorflow on anaconda python 3.6 如果我在 cmd 中测试它:

D:\>python
Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC
v.1
900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>> hello = tf.constant('Hello, TensorFlow!')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'tf' is not defined
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
2017-07-14 16:21:53.235367: W d:\build\tensorflow\tensorflow-
r1.2\tensorflow\cor
e\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled
to us
e SSE instructions, but these are available on your machine and could speed
up C
PU computations.
2017-07-14 16:21:53.508199: W d:\build\tensorflow\tensorflow-
r1.2\tensorflow\cor
e\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled
to us
e SSE2 instructions, but these are available on your machine and could speed
up
CPU computations.
2017-07-14 16:21:53.511766: W d:\build\tensorflow\tensorflow-
r1.2\tensorflow\cor
e\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled
to us
e SSE3 instructions, but these are available on your machine and could speed
up
CPU computations.
2017-07-14 16:21:53.515734: W d:\build\tensorflow\tensorflow-
r1.2\tensorflow\cor
e\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled
to us
e SSE4.1 instructions, but these are available on your machine and could
speed u
p CPU computations.
2017-07-14 16:21:53.517818: W d:\build\tensorflow\tensorflow-
r1.2\tensorflow\cor
e\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled
to us
e SSE4.2 instructions, but these are available on your machine and could
speed u
p CPU computations.
>>> print(sess.run(hello))
b'Hello, TensorFlow!'

所以这应该没问题....但是如果我尝试在 pycharm 中重复这个测试(即使在我重新启动 pycharm 之后):ModuleNotFoundError:没有名为“tensorflow”的模块

有什么想法吗?

最佳答案

只需从项目设置中安装 tensorflow。你不需要 python 。

enter image description here

关于python - 安装了tensorflow,但是pycharm忽略了它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45105651/

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