Using custom dataset on Tensorflow tutorial

Viewed 157

Tutorial followed: https://www.tensorflow.org/tutorials/text/transformer

Hello, so I am trying to adapt this code for use with my own English to English dataset.

My problem is with the line

(en.numpy() for pt, en in train_examples), target_vocab_size=2**15)

when the script is running it will return a AttributeError: 'str' object has no attribute 'numpy'.

The code works perfectly fine using the provided dataset. My dataset is a tsv file that has been preprocessed following this guide: https://www.tensorflow.org/datasets/add_dataset I am loading my dataset as follows:

examples, metadata = tfds.load('gen4data', 
    data_dir='./Data/Gen4Data/Data', download=False, with_info=True)
train_examples, val_examples = examples['train'], examples['test']

and then the rest of my code is the same as the one in the tutorials, so how do I fix my pipeline?

0 Answers
Related