Yes - this is a general template, and it is shown in the most general way. string_input_producer moves the reading order of data files. Each data file usually contains many examples, for efficiency. (Reading a million small files is very slow, itβs better to read 1000 large files with 1000 examples each.)
Therefore, examples from files are read into the shuffle queue, where they are shuffled with much less granularity, so examples from the same file are not always trained in the same order and mixed by the input files.
For more details, see Getting good mixing with many input data files in a tensor stream.
If your files contain only one input example, you do not need to shuffle several times and can only leave with string_input_producer , but note that it will still be useful for you to have a queue containing several images after reading, so that you can overlap the input and training your network. queue_runner for a batch or shuffle_batch will execute in a separate thread, ensuring that I / O occurs in the background and that images are always available for training. And, of course, this is normal for the speed of creating mini-baht for training.
source share