1、调用 tf.功能。
#原因是这个函数,不能按以前的方式进行调用了,只能使用命名参数的方式来调用。 #原来是这样的: tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(y, y_)) #修改成这样的: tf.reduce_sum(tf.nn.softmax_cross_entropy_with_logits(logits=y, labels=y_))
2、 tf.cocat([fw,bw],2)Error: int32, got list of type ‘’ .
int32,得到类型为“” inst的列表
原因是版本11的函数形式为:tf.(2,[fw,bw]),即要交换连接的维度和连接值的位置。
3、’Split’ Op 的输入”的类型与 int32 的类型不匹配
#原来是这样的: This is because in Tensorflow versions < 0.12.0 the split function takes the arguments as: x = tf.split(0, n_steps, x) # tf.split(axis, num_or_size_splits, value) #修改成这样的: The tutorial you are working from was written for versions > 0.12.0, which has been changed to be consistent with Numpy’s split syntax: x = tf.split(x, n_steps, 0) # tf.split(value, num_or_size_splits, axis)
4、‘’没有‘包’
因为后来的TF版本改了这个函数的名字,所以把tf.pack改成了tf.stack。
5、feed 的值是一个 tf. . feed , , lists 或 numpy
数据集由feed输入,需要feed的数据格式。
解决方法:img,label = sess.run[img,label],使用返回值。
6、 ‘..ops.nn’ 没有”
#原因是1.0版本改了不少地方啊... #原来是这样的: from tensorflow.python.ops import rnn, rnn_cell lstm_cell = rnn_cell.BasicLSTMCell(rnn_size,state_is_tuple=True) outputs, states = rnn.rnn(lstm_cell, x, dtype=tf.float32) #修改成这样的: from tensorflow.contrib import rnn lstm_cell = rnn.BasicLSTMCell(rnn_size) outputs, states = rnn.static_rnn(lstm_cell, x, dtype=tf.float32)
7、 basic/rnn// 不存在,或者不带 tf.()。您的意思是在 中设置reuse=None 吗?
with tf.variable_scope(scope_name, reuse=None) as scope: scope.reuse_variables() w = tf.get_variable("weight", shape, initializer = random_normal_initializer(0., 0.01))) b = tf.get_variable("biase", shape[-1], initializer = tf.constant_initializer(0.0)) #或: with tf.variable_scope(scope_name, reuse=True): w = tf.get_variable("weight") b = tf.get_variable("biase")
© 版权声明
本站下载的源码均来自公开网络收集转发二次开发而来,
若侵犯了您的合法权益,请来信通知我们1413333033@qq.com,
我们会及时删除,给您带来的不便,我们深表歉意。
下载用户仅供学习交流,若使用商业用途,请购买正版授权,否则产生的一切后果将由下载用户自行承担,访问及下载者下载默认同意本站声明的免责申明,请合理使用切勿商用。
THE END
暂无评论内容