成功解决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()

大功告成!哈哈!

 

 


本文转载:CSDN博客