报错信息
Traceback (most recent call last):
File "train.py", line 66, in <module>
train(config)
File "train.py", line 52, in train
n_epochs = config.epochs
File "/home/wangjl/test/Speech-Emotion-Re-master/models/dnn/dnn.py", line 89, in train
validation_data = (x_val, y_val)
File "/home/wangjl/anaconda3/envs/SER/lib/python3.6/site-packages/keras/engine/training.py", line 1184, in fit
tmp_logs = self.train_function(iterator)
File "/home/wangjl/anaconda3/envs/SER/lib/python3.6/site-packages/tensorflow/python/eager/def_function.py", line 885, in __call__
result = self._call(*args, **kwds)
File "/home/wangjl/anaconda3/envs/SER/lib/python3.6/site-packages/tensorflow/python/eager/def_function.py", line 950, in _call
return self._stateless_fn(*args, **kwds)
File "/home/wangjl/anaconda3/envs/SER/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 3040, in __call__
filtered_flat_args, captured_inputs=graph_function.captured_inputs) # pylint: disable=protected-access
File "/home/wangjl/anaconda3/envs/SER/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 1964, in _call_flat
ctx, args, cancellation_manager=cancellation_manager))
File "/home/wangjl/anaconda3/envs/SER/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 596, in call
ctx=ctx)
File "/home/wangjl/anaconda3/envs/SER/lib/python3.6/site-packages/tensorflow/python/eager/execute.py", line 60, in quick_execute
inputs, attrs, num_outputs)
tensorflow.python.framework.errors_impl.UnknownError: Fail to find the dnn implementation.
[[{{node CudnnRNN}}]]
[[sequential/lstm/PartitionedCall]] [Op:__inference_train_function_19686]
Function call stack:
train_function -> train_function -> train_function
tensorflow.python.framework.errors_impl.UnimplementedError: Cast string to float is not supported
[[node model/Cast (defined at train.py:306) ]] [Op:__inference_train_function_30543]
解决方案
在train.py加入
import tensorflow as tf
tf.compat.v1.disable_eager_execution()