Fwiw the docs literally suggest doing this (i.e. calling it manually) if necessary:
https://pytorch-lightning.readthedocs.io/en/latest/data/datamodule.html#using-a-datamodule
If you need information from the dataset to build your model, then run
prepare_data
andsetup
manually (Lightning ensures the method runs on the correct devices).
Although I’ve found the result of that being that trainer will just call setup() again