zl程序教程

您现在的位置是:首页 >  其它

当前栏目

成功解决AttributeError: module 'tensorflow.contrib.data' has no attribute 'TextLineDataset'

解决 成功 Data No Tensorflow module has attribute
2023-09-14 09:04:51 时间

成功解决AttributeError: module 'tensorflow.contrib.data' has no attribute 'TextLineDataset'

 

 

目录

解决问题

解决思路

解决方法


 

 

解决问题

AttributeError: module 'tensorflow.contrib.data' has no attribute 'TextLineDataset'

 

 

 

解决思路

tensorflow版本问题导致的函数调用有变更。
(1)、tf.data.TextLineDataset():这个函数的输入是一个文件的列表,输出是一个dataset。dataset中的每一个元素就对应了文件中的一行。可以使用这个函数来读入CSV文件。

 

 

 

解决方法


旧版本的函数
改为
tf.data.TextLineDataset()

大功告成!哈哈!