【发布时间】:2020-02-23 00:16:10
【问题描述】:
我正在尝试使用以下代码运行一个简单的 LSTM 模型
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.LSTM(32,
input_shape=x_train_single.shape[-2:]))
model.add(tf.keras.layers.Dense(1))
model.compile(optimizer=tf.keras.optimizers.RMSprop(), loss='mae')
single_step_history = model.fit(train_data_single, epochs=EPOCHS,
steps_per_epoch=EVALUATION_INTERVAL)
尝试拟合模型时发生错误
tensorflow.python.framework.errors_impl.UnknownError: [_Derived_] Fail to find the dnn implementation.
[[{{node CudnnRNN}}]]
[[sequential/lstm/StatefulPartitionedCall]] [Op:__inference_distributed_function_3107]
还有一个类似这样的错误
2020-02-22 19:08:06.478567: W tensorflow/core/kernels/data/cache_dataset_ops.cc:820] The calling
iterator did not fully read the dataset being cached. In order to avoid unexpected truncation of the
dataset, the partially cached contents of the dataset will be discarded. This can happen if you have
an input pipeline similar to `dataset.cache().take(k).repeat()`. You should use
`dataset.take(k).cache().repeat()` instead.
我在这个 question 上尝试了所有方法,但对我不起作用
我的环境是
tensorflow-gpu 2.0
CUDA v10
CuDNN 7.6.5
解决方案
好的..我发现我没有最新的Nvidia驱动,所以我升级了,并且可以工作
【问题讨论】:
标签: python tensorflow