tensorflow1.1的几个api变动

tf.nn,run_cell.BasicLSTMCell,DropoutWrapper,MultiRNNCell
 
 
AttributeError: module 'tensorflow.contrib.rnn' has no attribute 'BasicLSTMCell'
报这个错是因为api变了,找了好久的源码才找到
from tensorflow.contrib.rnn.python.ops.core_rnn_cell_impl import BasicLSTMCell,DropoutWrapper,MultiRNNCell
导的包换成这个就行了
还有一个
 
 
module 'tensorflow.python.ops.nn' has no attribute 'seq2seq'
能到这步就不介绍seq2swq了,大约就像翻译机一样的
 
 
from tensorflow.contrib import seq2seq
换成这个api就能解决,另外,里面的参数也要做相应的修改,否则还是会报错,具体怎么修改,看源码呗
 

猜你喜欢

转载自blog.csdn.net/qq_36421826/article/details/72885905