我正在尝试使用R中的tfestimator
包来复制使用mtcars
数据框进行线性模型预测的示例,但出现以下错误:
# input function
input <- input_fn(mtcars,
features = c("drat", "mpg", "am"),
response = "vs",
batch_size = 128,
epochs = 3)
# feature columns
cols <- feature_columns(
column_numeric("drat"),
column_indicator("am")
)
Error in py_get_attr_impl(x, name, silent) :
AttributeError: module 'tensorflow.python.feature_column.feature_column' has no attribute 'numeric_column'
In addition: Warning message:
`quo_expr()` is deprecated as of rlang 0.2.0.
Please use `quo_squash()` instead.
This warning is displayed once per session.
# construct feature columns
linear_feature_columns <- feature_columns(column_numeric("mpg"))
dnn_feature_columns <- feature_columns(column_numeric("drat"))
Error in py_get_attr_impl(x, name, silent) :
AttributeError: module 'tensorflow.python.feature_column.feature_column' has no attribute 'numeric_column'
我正在使用最新版本的TensorFlow,但我不知道为什么会收到此错误。