Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'tensorflow' has no attribute 'placeholder' #202

Open
mengxin239 opened this issue Mar 27, 2022 · 0 comments
Open

Comments

@mengxin239
Copy link

大佬您好,我在安装tensorflow1.7.0时报错,安装了1.8.2,请问这个对整个项目的运行有影响吗?
在我运行python3 tran_model.py的时候,他报出了如下错误
`Traceback (most recent call last):
File "train_model.py", line 274, in
main()
File "train_model.py", line 268, in main
image_suffix, train_batch_size, test_batch_size, verify=False)
File "train_model.py", line 59, in init
super(TrainModel, self).init(image_height, image_width, len(label), char_set, model_save_dir)
File "/content/cnnlib/network.py", line 22, in init
self.X = tf.placeholder(tf.float32, [None, self.image_height * self.image_width]) # 特征向量
AttributeError: module 'tensorflow' has no attribute 'placeholder'

CalledProcessError Traceback (most recent call last)
in ()
----> 1 get_ipython().run_cell_magic('shell', '', 'python3 train_model.py')

2 frames
/usr/local/lib/python3.7/dist-packages/google/colab/_system_commands.py in check_returncode(self)
137 if self.returncode:
138 raise subprocess.CalledProcessError(
--> 139 returncode=self.returncode, cmd=self.args, output=self.output)
140
141 def repr_pretty(self, p, cycle): # pylint:disable=unused-argument

CalledProcessError: Command 'python3 train_model.py' returned non-zero exit status 1.`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant