此处遇到的问题及解决方法,只是针对我的tensorflow运行环境。
错误类型:TypeError: Expected int32, got listcontaining Tensors of type '_Message' instead.
翻译:TypeError:预期Int32,得到含类型“_message '张量代替列表。
错误点: output =tf.reshape(tf.concat(outputs,1),[-1,HIDDEN_SIZE])
修改:tf.concat(1,outputs)->tf.concat(outputs,1)
错误类型:AttributeError:module 'tensorflow.python.ops.nn' has no attribute 'seq2seq'
翻译:模块tensorflow。蟒蛇行动。NN”没有属性的seq2seq”
错误点:tf.nn.seq2seq.sequence_loss_by_example
修改:tf.contrib.legacy_seq2seq.sequence_loss_by_example
错误类型:AttributeError: module'reader' has no attribute 'ptb_iterator'
翻译:reader模块中没有ptb_iterator函数
错误点:tensorflow1.0版本中对reader模块进行了改进将ptb_iterator改成了ptb_producer
修改:将ptb_iterator改成ptb_producer
错误类型:在windows环境下的DOS命令框运行 .py文件出错
翻译:
错误点:在DOS命令下运行.py文件需要加入完整的路径
修改:python 路径\xxx.py
错误类型:NotFoundError: Keybeta2_power_4 not found in checkpoint
翻译:
错误点:模型运行第一次后,再运行就会报此错
修改:关闭当前py文件,再打开运行即可解决