python - 'tensorflow_core.estimator' 没有属性 'inputs' ,为什么会发生这种情况?

标签 python tensorflow

我正在 jupyter notebook 中运行神经网络算法。

input_func = tf.estimator.inputs.pandas_input_fn(
    x=X_train,
    y=y_train,
    batch_size=10,
    num_epochs=5,
    shuffle=True)

产生这个错误:

AttributeError: module 'tensorflow_core.estimator' has no attribute 'inputs'



我不明白为什么会这样。我尝试卸载并重新安装 tensorflow。

有谁知道如何解决这一问题?

最佳答案

如果您正在运行 TF 2.00。您可以检查版本

print(tf.__version__)

使用 tf.compat.v1.estimator.inputs.pandas_input_fn反而

关于python - 'tensorflow_core.estimator' 没有属性 'inputs' ,为什么会发生这种情况?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58491244/

相关文章:

python - Spark SQL 读取 40 万行时出现内存不足错误

使用广播语义进行转置的tensorflow concat

python - Tensorflow 自动编码器成本不会降低?

python - 使用 tf.data API、TFRecordDataset 和序列化时出现问题

Python pandas 使用带有自定义 agg 函数的 groupby 创建新列

python - 如何使用 Tox/Py.test 显示完整的 Python Traceback

python,匀称 : How to determine if two polygons cross each other,,同时允许它们的边缘重叠

machine-learning - 为什么 tf.Session().run() 在这里不起作用?

python - ValueError - 将图像数组输入字典

python - SQLAlchemy的 `one_or_none`查询方法如何使用?