深度学习: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

猜你喜欢

转载自blog.csdn.net/weixin_44575717/article/details/125335925
今日推荐