I have read a csv file using numpy genfromtxt
csv_file = np.genfromtxt(args.dataset, delimiter=',',skip_header=1,usecols=(0,1,2,3,4,5), dtype=None)
Ques: How to use string_input_producer to queue and batch the files.
I have read a csv file using numpy genfromtxt
csv_file = np.genfromtxt(args.dataset, delimiter=',',skip_header=1,usecols=(0,1,2,3,4,5), dtype=None)
Ques: How to use string_input_producer to queue and batch the files.
You can read a Numpy array from CSV as you do and chop it up into batches manually. However, TF has a built-in functionality of reading from multiple CSV files and putting rows together either into randomized or sequential batches. You can read cells of varying data-types and convert them into your relevant data-types as need be.
The working code to do this is discussed in this question: Converting TensorFlow tutorial to work with my own data
In a nutshell, the key functions you need are tf.TextLineReader
, tf.train.string_input_producer
, and tf.train.shuffle_batch
, or tf.train.batch
, depending on your needs.
The only limitation of that method that I'm aware of is that your rows within the CSV file should be of equal length.