Questions tagged [tf.data.dataset]

145 questions
0
votes
0 answers

How to use tf.dataset to train a Google universal sentence encoder?

The problem is the following: the Universal Sentence Encoder takes a list of strings as input and tf.Data doesn't work with the list. Therefore, how to make the pipeline output a list to feed the Universal Sentence Encoder layer? Here is a sample of…
Marlon Teixeira
  • 334
  • 1
  • 14
0
votes
0 answers

How to fix a ValueError for Dense layer input shape when training a CNN with tensorflow.data.datasets?

I am building a CNN using the Model class and I have encountered an error that when I switch from convolutional layers to dense layers, the model breaks and throws a value error. My training data is a tf.data.Dataset (I am new to using this) and it…
AGO_24
  • 1
  • 1
0
votes
2 answers

Access values in dict in tf.dataset.Dataset.map with tf.striing

I am creating a tf.data.Dataset where I start with list_files to get all paths to my images. The annotations are stored on disc as json files. The structure of the json file is { "img1.png": { data ... }, …
El_Loco
  • 1,716
  • 4
  • 20
  • 35
0
votes
0 answers

How to create tf.data.Dataset for one image input and multiple outputs neural network?

I have a 1 input 7 output neural network. The input is an image and all the 7 outputs are different categories. My images are stored in image directory. And, labels are stored in a CSV file. I have created a list where x_train_path is a path to…
0
votes
1 answer

Passing Argument to a Generator to build a tf.data.Dataset

I am trying to build a tensorflow dataset from a generator. I have a list of tuples called some_list , where each tuple has an integer and some text. When I do not pass some_list as an argument to the generator, the code works fine import tensorflow…
Arindam
  • 128
  • 7
0
votes
1 answer

Evaluating a tensorflow model on different levels of augmented data

I am trying to build a noise-robust audio classification model. To evaluate my results I would like to run a loop to use model.evaluate() on a tf.dataset object that consists of my validation data augmented with different levels of noise. Here is my…
0
votes
0 answers

'MapDataset' object is not subscriptable and TFRecords parsing

I have a list of TFRecords files storing a variable X (variable number of rows and 268 columns) and Y (same number of elements as X). When I try to parse them in order to pass them directly to the keras.fit() method, I get a 'MapDataset' object is…
0
votes
1 answer

how to extract label in processing image with tf.data

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…
0
votes
0 answers

Keras changing from ndarray to tensorflow data leads to error

I'm training a model with tensorflow keras and numpy input with: epochs = 10 batch_size = 128 model.fit( x = [train_asset_text_seq, train_bug_text_seq], y = y_train.values.reshape(-1,1), epochs = epochs, batch_size=batch_size, …
fsulser
  • 853
  • 2
  • 10
  • 34
0
votes
1 answer

TF Dataset with CSV file where image is stored in another directory

I'm trying to create an input dataset into my TF model using a CSV dataset that I have. The dataset has the following scheme: image_name, label XXXXXXX.png, some_integer_value XXXXXXX.png, some_integer_value I did a bit of research and found that…
0
votes
0 answers

TFRecords in a custom DataGenerator

I am doing an LSTM model in which samples have different number of time steps. I want to optimise my code and performance so I do not want to use masking, but I want to write a generator that will group automatically the batches with the same number…
0
votes
1 answer

Tensorflow: Creating a TensorFlow dataset using multi-dimensional input data with differing length. (Video Data)

The problem I am having is part of my 4th-year university project. The project is to translate sign language. The set-up I have at the moment for the input data is a NumPy array of shape [n_videos] each video in this list is a NumPy tensor of the…
0
votes
1 answer

Convert a PyTorch dataloader to tf.Dataset?

How can we convert a torch.utils.data.DataLoader data loader to a tf.Dataset? I spied this snippet def convert_pytorch_dataloader_to_tf_dataset( dataloader, batch_size, shuffle=True ): dataset = tf.data.Dataset.from_generator( …
neel g
  • 1,138
  • 1
  • 11
  • 25
0
votes
1 answer

tf.data multi output model has labels with incompatible shapes

I am trying to convert an workbook I did some time ago on Colab (using ImageDataGenerator) to one that uses tf.data.dataset as I now have a multi-gpu set up and am trying to learn how to do faster training. The model trains on the age/ gender/ race…
0
votes
2 answers

Tensorflow can't append batches together after doing the first epoch

I am running into problems with my code after I removed the loss function of the compile step (set it equal to loss=None) and added one with the intention of adding another, loss function through the add_loss method. I can call fit and it trains for…
under_the_sea_salad
  • 1,754
  • 3
  • 22
  • 42