深度学习:from tensorflow.contrib.rnn import LSTMStateTuple没有contrib模块

 from tensorflow.contrib.rnn import LSTMStateTuple

报错:ModuleNotFoundError: No module named ‘tensorflow.contrib‘

更改代码

import tensorflow._api.v2.compat.v1 as tf
tf.disable_v2_behavior()
from tensorflow._api.v2.compat.v1.nn.rnn_cell import LSTMStateTuple

你可能感兴趣的:(实战深度学习常见问题汇总,tensorflow,深度学习,rnn,神经网络,人工智能)