gpt4 book ai didi

python - 属性错误 : module 'tensorflow' has no attribute 'feature_column'

转载 作者:太空宇宙 更新时间:2023-11-03 14:49:32 24 4
gpt4 key购买 nike

所以我是机器学习的新手,正在尝试这里给出的 TensorFlow 线性模型教程: https://www.tensorflow.org/tutorials/wide

我真的只是下载了他们的教程并试图在我的电脑上运行它但是我得到了错误:

AttributeError: module 'tensorflow' has no attribute 'feature_column'

我在网上搜索并了解到这可能发生在旧版本的tensorflow上,但我运行的是最新版本:1.3.0

那么为什么我会收到此错误以及如何修复它?

最佳答案

Tensorflow 1.3 应该能很好地支持 feature_column。您可能不小心使用了旧版本。尝试使用以下代码来验证您的版本:

import tensorflow as tf
print(tf.__version__)
print(dir(tf.feature_column))

关于python - 属性错误 : module 'tensorflow' has no attribute 'feature_column' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46882307/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com