tensorflow常见错误总结

此处遇到的问题及解决方法,只是针对我的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文件,再打开运行即可解决

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值