我一直在尝试使用tensorflow两天,现在在python2.7和3.4中反复安装和重新安装它.无论我做什么,我在尝试使用tensorflow.placeholder()时都会收到此错误消息
这是非常的样板代码:
tf_in = tf.placeholder("float", [None, A]) # Features
Run Code Online (Sandbox Code Playgroud)
无论我做什么,我总会得到回溯:
Traceback (most recent call last):
File "/home/willim/PycharmProjects/tensorflow/tensorflow.py", line 2, in <module>
import tensorflow as tf
File "/home/willim/PycharmProjects/tensorflow/tensorflow.py", line 53, in <module>
tf_in = tf.placeholder("float", [None, A]) # Features
AttributeError: 'module' object has no attribute 'placeholder'
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这个问题?
我已经安装了tensorflow版本r0.11。
在我的文件名中,cartpole.py我已经导入tensorflow:
import tensorflow as tf
Run Code Online (Sandbox Code Playgroud)
并使用它:
tf.reset_default_graph()
Run Code Online (Sandbox Code Playgroud)
尝试在PyCharm中运行我的项目时出现以下错误:
in <module>
tf.reset_default_graph()
AttributeError: module 'tensorflow' has no attribute 'reset_default_graph'
Run Code Online (Sandbox Code Playgroud)
如何解决此错误?