tf.data.dataset

tf.data.datasets set each batch (prefetch)

tf.data.datasets set each batch (prefetch) Question: I am looking for help thinking through this. I have a function (that is not a generator) that will give me any number of samples. Let’s say that getting all the data I want to train (1000 samples) can’t fit into memory. So I want to call this function …

Total answers: 1

Convert list of tuples to tensorflow dataset (tf.data.Dataset)

Convert list of tuples to tensorflow dataset (tf.data.Dataset) Question: Data from kaggle Natural Language Processing with Disaster Tweets ds_train >>>[("Already expecting to be inundated w/ articles about trad authors’ pay plummeting by early next year but if this is true it’ll be far worse", 0) (‘@blazerfan not everyone can see ignoranceshe is Latinoand that is …

Total answers: 1

Normalisation layer for tf.data.Dataset

Normalisation layer for tf.data.Dataset Question: I am trying to improve the Tensorflow tutorial on Time series forecasting. The code is quite long, but my doubt regards only a small part of it. In the tutorial the data is normalized is the usual way: it is demeaned and standardized using the mean and standard deviation of …

Total answers: 1

how to extract label in processing image with tf.data

how to extract label in processing image with tf.data Question: I am using map function to apply preprocessing on dataset in order to read and extract labels from file paths using tf.data but it returns the same label for all images the file path is on the following shape where A is the label /content/drive/MyDrive/prom02/dataset/train/A0_jpg.rf.292a080422ba984985192f413101af41.jpg …

Total answers: 1

Invalid argument: Dimension -972891 must be >= 0

Invalid argument: Dimension -972891 must be >= 0 Question: I have created a data pipeline using tf.data for speech recognition using the following code snippets: def get_waveform_and_label(file_path): label = tf.strings.split(file_path, os.path.sep)[-2] audio_binary = tf.io.read_file(file_path) audio, _ = tf.audio.decode_wav(audio_binary) waveform = tf.squeeze(audio, axis=-1) return waveform, label def get_spectrogram(waveform): # Padding for files with less than 16000 …

Total answers: 4