TypeError: while_loop() got an unexpected keyword argument 'maximum_iterati

keras版本与TensorFlow版本不匹配错误

参考:https://github.com/keras-team/keras/issues/10270

报错提示为:
~\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py in rnn(step_function, inputs, initial_states, go_backwards, mask, constants, unroll, input_length)
   2960             parallel_iterations=32,
   2961             swap_memory=True,
-> 2962             maximum_iterations=input_length)
   2963         last_time = final_outputs[0]
   2964         output_ta = final_outputs[1]

TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations'

更改 keras的版本

Had the same issue with Keras 2.2.0 & tensorflow-gpu 1.8.0 . Reverted back to 2.1.6 and model fits without error.
pip uninstall keras
pip install keras==2.1.6

猜你喜欢

转载自blog.csdn.net/wangwangstone/article/details/86491659