Tensorflow datasets

I have a tensorflow dataset (as numpy generator) with all the preprocessing required.

What is the best way to convert it into torch.utils.data.Dataset and later torch.utils.data.Dataloader?


When you mean a numpy generator, you mean that it already contains a sampler? Or can you extract all the data from it beforehand?
To build a dataset, you need to be able to access a particular element, you cannot do it with only a generator I’m afraid.

Note that you can still bypass the Dataset/Dataloader completely if you don’t need them and just add a couple torch.from_numpy() in your training loop beore passing the data to your model!