python版本:python3.7.4
tensorflow版本:tensorflow-2.2.0
- error: module ‘tensorflow’ has no attribute 'variable_scope’
- error:module ‘tensorflow._api.v2.nn’ has no attribute 'rnn_cell’
- AttributeError: module ‘tensorflow’ has no attribute 'get_variable’
- AttributeError: module ‘tensorflow’ has no attribute 'string_split’
- AttributeError: ‘PaddedBatchDataset’ object has no attribute 'make_initializable_iterator’
用tf.compat.v1
替换tf
AttributeError: ‘PaddedBatchDataset’ object has no attribute ‘compat’
将
data = MakeSrcTrgDataset(file_name1, file_name2, batchsize)
iterator = data.make_initializable_iterator() # 迭代器
改为
data = MakeSrcTrgDataset(file_name1, file_name2, batchsize)
iterator = tf.compat.v1.data.make_initializable_iterator(data) # 迭代器
抛出另一种错误!!!
最后乖乖安装 tensorflow 1.0版
pip install tensorflow-gpu==1.14.0