nickliqian / cnn_captcha

use cnn recognize captcha by tensorflow. 本项目针对字符型图片验证码,使用tensorflow实现卷积神经网络,进行验证码识别。
Apache License 2.0
2.76k stars 783 forks source link

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

Open mengxin239 opened 2 years ago

mengxin239 commented 2 years ago

大佬您好,我在安装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 _reprpretty(self, p, cycle): # pylint:disable=unused-argument

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