diff --git a/otbtf/tfrecords.py b/otbtf/tfrecords.py
index 123bdea554d07eb537fcd7455747db00bd7ce110..254efd2a311b7a4e11d10876f653814b6c13a425 100644
--- a/otbtf/tfrecords.py
+++ b/otbtf/tfrecords.py
@@ -172,6 +172,9 @@ class TFRecords:
         :param num_parallel_calls: number of parallel calls for the parsing + preprocessing step
         :param kwargs: some keywords arguments for preprocessing_fn
         """
+        for dic, file in zip([self.output_types, self.output_shapes], [self.output_types_file, self.output_shapes_file]):
+            assert dic, f"The file {file} is missing!"
+
         options = tf.data.Options()
         if shuffle_buffer_size:
             options.experimental_deterministic = False  # disable order, increase speed