why dataset.output_shapes returns demension(none) after batching

前端 未结 2 1206
故里飘歌
故里飘歌 2021-01-20 00:19

I\'m using the Dataset API for input pipelines in TensorFlow (version: r1.2). I built my dataset and batched it with a batch size of 128. The dataset fed into the RNN.

2条回答
  •  心在旅途
    2021-01-20 00:46

    This feature has been added with the drop_remainder parameter used like the following:

    batch_test_dataset = test_dataset.batch(FLAGS.batch_size, drop_remainder=True)
    

    From the docs:

    drop_remainder: (Optional.) A tf.bool scalar tf.Tensor, representing whether the last batch should be dropped in the case its has fewer than batch_size elements; the default behavior is not to drop the smaller batch.

提交回复
热议问题