pythontensorflowtensorflow-estimator

tensorflow.estimator error: TypeError: 'builtin_function_or_method' object is not iterable


I can't seem to find the issue in the code that causes the error. I would appreciate it if you could help. Thanks in advance! The error generated from the code below is

TypeError: 'builtin_function_or_method' object is not iterable

n_batches = 1
est = tf.estimator.BoostedTreesClassifier(feature_columns,
                                          n_batches_per_layer=n_batches)

est.train(train_input_fn, max_steps=100)

result = est.evaluate(eval_input_fn.())
clear_output()
print(pd.Series(result))

Solution

  • Change to: result = est.evaluate(eval_input_fn)

    The ()brackets after the eval_input_fn is not required, just like the way train_input_fn is passed to train()

    TF documentation defines the input_fn as

    A function that constructs the input data for evaluation.