add_argparse_args
raises TypeError
with Python 3.6 when class has arg typed Generic
#9535
Labels
bug
Something isn't working
data handling
Generic data-related topic
help wanted
Open to be worked on
🐛 Bug
When a
LightningDataModule
has args typedtorch.utils.data.Dataset
, it throwsTypeError
.possible cause
As far as I investigated, it seems like the error occurs only when a class has
typing.Generic
-typed args (or any subclass oftyping.Generic
, e.g.torch.utils.data.Dataset
). Note that it doesn't occur when args are typed astorch.nn.Module
, for example.Since
typing.GenericMeta
is removed in 3.7 (PEP 560), the error doesn't occur in Python 3.7 or later.To Reproduce
Expected behavior
.add_argparse_args
doesn't raiseTypeError
and just ignores class args typedGeneric
using Python 3.6.Environment
Additional context
This error was found while handling Lightning-Universe/lightning-bolts#466.
The text was updated successfully, but these errors were encountered: