About the tf.contrib.data.Dataset
(from TensorFlow 1.2, see here and here) usage:
The way how to get data doesn't really fit any way how I get the data usually. In my case, I have a thread and I receive data there and I don't know in advance when it will end but I see when it ends. Then I wait until I processed all the buffers and then I have finished one epoch. How can I get this logic with the Dataset
?
Note that I prefer the Dataset
interface over the QueueBase
interface because it gives me the iterator interface which I can reinitialize and even reset to a different Dataset
. This is more powerful compared to queues which cannot be reopened currently after they are closed (see here and here).
Maybe a similar question, or the same question: How can I wrap around a Dataset
over a queue? I have some thread with reads some data from somewhere and which can feed it and queue it somehow. How do I get the data into the Dataset
? I could repeat some dummy tensor infinite times and then use map
to just return my queue.dequeue()
but that really only gets me back to all the original problems with the queue, i.e. how to reopen the queue.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…