train-CLIP-FT
train-CLIP-FT copied to clipboard
`train_dataloader` must be implemented to be used with the Lightning Trainer
hello I am going to train CLIP with my own dataset, but I met a exception :
raise MisconfigurationException("
train_dataloader
must be implemented to be used with the Lightning Trainer") lightning_fabric.utilities.exceptions.MisconfigurationException:train_dataloader
must be implemented to be used with the Lightning Trainer
Where should I define my own "train_dataloader" function and how can I call it?
Could you please give me a template ?
The best wishes!
I add a function in models/wrapper.py in class CLIPWrapper(pl.LightningModule): ` class CLIPWrapper(pl.LightningModule):
add this function
def train_dataloader(self):
return self.trainer.datamodule.train_dataloader()
`
and it works!