Categories
Misc

Tensorflow2 traning with TFRecords: TypeError: ‘NoneType’ object is not callable

Hi everyone,

I have a question about TFRecords and how to train tf.keras models with them. For this I built a toy example, loading the iris dataset, writing the the data to a TFRecord, reading it back in and trying to train a simple MLP I found in a tutorial.

For encoding/writing/reading/decoding the TFRecords I followed mostly the official [Tutorial](https://www.tensorflow.org/tutorials/load_data/tfrecord). As far as I am able to see I can recover the original data, so I thought I plug the dataset into the MLP as the [fit method](https://www.tensorflow.org/api_docs/python/tf/keras/Model#fit) should be able to work with tf.data datasets. In an example notebook with the MNIST dataset it worked fine, but in my case fit throws the following error:

TypeError: 'NoneType' object is not callable 

I copied the notebook to gist.

Does anybody know, how to solve this problem or if I am doing something wrong?

P.S.: I already tried to reshape the tensors, as some posts mentioned that the shapes are not always recovered.

submitted by /u/fXb0XTC3
[visit reddit] [comments]

Leave a Reply

Your email address will not be published.