Skip to content
Advertisement

Tensorflow Keras evaluate method return a empty list

Hello i am follow the time series forecasting tutorial in tensorflow https://www.tensorflow.org/tutorials/structured_data/time_series, I have the same project, the only difference is that I am using a different dataset, when evaluating the models, the model.evaluate () method returns an empty list, it does not return a value.

When the model is trained with the fit() method, evaluation values are generated in training. But not with the evaluate() method.

This the class WindowGenerator Class:

JavaScript

This is the definition of multiwindow object:

JavaScript

This is the training method:

JavaScript

This is the model:

JavaScript

This is the training and evalue:

JavaScript

And is the output in the print result:

JavaScript

Advertisement

Answer

I had the same issue when doing this tutorial (knowing what is done in the tutorial might help you understand this issue and my answer).

When you call:

JavaScript

You evaluate your model on the validation dataset (called val_df in the WindowGenerator class). Your issue happened because the size of your validation dataset is smaller than the total size of the window.

When you make your window:

JavaScript

The size of your window is 150, so you should have a validation dataset bigger than 150. The solution to your issue is to use a bigger dataset or resize your window.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement