I follow the tutorial https://www.tensorflow.org/tutorials/layers and I want use it to use my own dataset.
def train_input_fn_custom(filenames_array, labels_arra
The input_fn
argument to classifier.train()
must be a callable object (with no arguments), such as a function or a lambda
. In your code, you are passing the results of calling train_input_fn_custom()
, rather than a callable object that invokes train_input_fn_custom()
. To fix this issue, replace the definition of cust_train_input_fn
as follows:
# The `lambda:` creates a callable object with no arguments.
cust_train_input_fn = lambda: train_input_fn_custom(
filenames_array=filenames_train, labels_array=labels_train, batch_size=3)