Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tensorflow 动态:TF和v之间的性能不一致。1.0.0和1.2.0_Tensorflow_Lstm - Fatal编程技术网

Tensorflow 动态:TF和v之间的性能不一致。1.0.0和1.2.0

Tensorflow 动态:TF和v之间的性能不一致。1.0.0和1.2.0,tensorflow,lstm,Tensorflow,Lstm,考虑到从TF版本1.0.0升级到1.2.0后性能急剧下降,我试图了解我的GRUCell和dynamic\u rnn有什么问题 旧环境是Ubuntu,Python版本2.7,TF版本1.0.0,新环境是Ubuntu,Python版本3.5.3,TF版本1.2.0 我在1.2版的发行说明中看到,多层RNN的实现方式有一些变化,对1.1版之前的版本的实现方式有一些影响,所以我想我应该尝试一下 旧代码的相关部分通常如下所示: cell = tf.nn.rnn_cell.GRUCell(CELL_SIZE

考虑到从TF版本1.0.0升级到1.2.0后性能急剧下降,我试图了解我的
GRUCell
dynamic\u rnn
有什么问题

旧环境是Ubuntu,Python版本2.7,TF版本1.0.0,新环境是Ubuntu,Python版本3.5.3,TF版本1.2.0

我在1.2版的发行说明中看到,多层RNN的实现方式有一些变化,对1.1版之前的版本的实现方式有一些影响,所以我想我应该尝试一下

旧代码的相关部分通常如下所示:

cell = tf.nn.rnn_cell.GRUCell(CELL_SIZE)
cell = tf.contrib.rnn.DropoutWrapper(cell, output_keep_prob=keep_prob)
multicell = tf.nn.rnn_cell.MultiRNNCell([cell]*N_LAYERS, state_is_tuple=False)

output, state = tf.nn.dynamic_rnn(multicell, X, dtype=tf.float32, initial_state=in_state)

preds = tf.contrib.layers.linear(output, 1)
loss = tf.reduce_mean(tf.square(preds - Y_))
train_step = tf.train.AdamOptimizer(LR).minimize(loss)
preds = tf.reshape(preds, [batchsize, -1], name='preds')
cells = [tf.nn.rnn_cell.GRUCell(INTERNALSIZE) for _ in range(NLAYERS)]
dropcells = [tf.contrib.rnn.DropoutWrapper(cell,input_keep_prob=keep_prob) for cell in cells]
multicell = tf.nn.rnn_cell.MultiRNNCell(dropcells, state_is_tuple=False)
multicell = tf.contrib.rnn.DropoutWrapper(multicell, output_keep_prob=keep_prob)

output, state = tf.nn.dynamic_rnn(multicell, X, dtype=tf.float32, initial_state=in_state)

preds = tf.contrib.layers.linear(Yr, 1)
loss = tf.reduce_mean(tf.square(preds - Y_))
train_step = tf.train.AdamOptimizer(LR).minimize(loss)
preds = tf.reshape(preds, [batchsize, -1], name='preds')
我在报告中看到:

大宗报价 RNNCell对象现在是tf.layers.Layer的子类。TensorFlow 1.1版本中描述的严格性已经消失:第一次使用RNNCell时,它会缓存其范围。RNNCell的所有未来用途都将重用同一范围内的变量。这是TensorFlow版本中RNNCells行为的突破性变化