Obtaining total number of records from .tfrecords file in Tensorflow

后端 未结 4 1949
南方客
南方客 2020-12-13 10:27

Is it possible for obtain the total number of records from a .tfrecords file ? Related to this, how does one generally keep track of the number of epochs that h

4条回答
  •  悲&欢浪女
    2020-12-13 10:40

    As tf.io.tf_record_iterator is being deprecated, the great answer of Salvador Dali should now read

    tf.enable_eager_execution()
    sum(1 for _ in tf.data.TFRecordDataset(file_name))
    

提交回复
热议问题