Category : split

dataset, info = tfds.load(‘oxford_iiit_pet:3.*.*’, with_info=True) train_images = dataset[‘train’] test_images = dataset[‘test’] train_batches = ( train_images .cache() .shuffle(BUFFER_SIZE) .batch(BATCH_SIZE) .prefetch(buffer_size=tf.data.AUTOTUNE)) test_batches = test_images.batch(BATCH_SIZE) Now I would like to reduce the test_images size to 100 images. I am expecting some code like: test_images = test_images[100] But this would give an error saying: ‘ParallelMapDataset’ object is not subscriptable ..

Read more

Let’s say I have a list of concatenated firstname + lastname combinations like: ["samsmith","sallyfrank","jamesandrews"]. I also have lists possible_firstnames, and possible_lastnames. If I want to split those full name strings based on values that appear in possible_firstnames and possible_lastnames, what is the best way of doing so? My initial strategy was to compare characters between ..

Read more