callmeGuy
callmeGuy

Reputation: 1034

How is random_batch deprecated in Tensorflow?

I was doing this tutorial and I got stuck at the line with data.random_batch(batch_size=train_batch_size). It's looking like there's been some deprecation in tensorflow. I am getting the following error:

AttributeError: 'Datasets' object has no attribute 'random_batch'

I've been googling for a solution, but no luck. Does anyone know where this method hides now?

Upvotes: 0

Views: 318

Answers (1)

D_negn
D_negn

Reputation: 378

You can use tf.data.dataset.batch(batch_size = train_batch_size) for batching the input data but for that frist you have to create a dataset from your input data by using the relevant method for your data for example dataset = tf.data.TFRecordDataset(filename). After that you can create an iterator to get each batch for training by defining an iterator dataset.make_one_shot_iterator(). A detailed explanation could be find on the tensorflow guide here

Upvotes: 3

Related Questions