AttributeError: BinaryMNISTDataModule
object has no attribute train_transforms
#934
Labels
help wanted
Extra attention is needed
🐛 Bug
To Reproduce
Trying to run the code from the docs here: https://lightning-bolts.readthedocs.io/en/stable/datamodules/vision.html#binarymnist
Steps to reproduce the behavior: Run the code from that page:
Expected behavior
It shouldn't error :)
Environment
pytorch-lightning: 1.7.7
lightning-bolts: 0.5.0
Additional context
Adding this makes it work:
This check (and the
val
counterpart) are assuming the existence of an attribute that isn't defined as a default.From https://github.com/Lightning-AI/lightning-bolts/blob/master/pl_bolts/datamodules/vision_datamodule.py#L103
I don't know the codebase well, but it looks like either
train_transforms
should have a default value, or ahasattr()
check should be added, or query the value with a fallback, likeif getattr(self, 'train_transforms', None) is None
Or maybe I'm doing something wrong. The docs have this cryptic little message about transforms, with no context. What is this saying, what is
transform_lib
, what am I supposed to do withmnist_transforms
?The text was updated successfully, but these errors were encountered: