transformer_pytorch icon indicating copy to clipboard operation
transformer_pytorch copied to clipboard

TypeError: issubclass() arg 1 must be a class

Open Gaming722 opened this issue 2 years ago • 0 comments

https://github.com/cpm0722/transformer_pytorch/blob/76597a44348b42cb01f4728066795a4d03a1ff06/main.py#L20

If someone runs the above code and gets the following error:

File "/home/user_name/anaconda3/envs/transformer_pytorch/lib/python3.9/typing.py", line 852, in __subclasscheck__
    return issubclass(cls, self.__origin__)
TypeError: issubclass() arg 1 must be a class

Then ensuring that the typing_extension is version 4.5.0 may fix this bug:

pip install typing_extensions==4.5.0

Gaming722 avatar Nov 06 '23 12:11 Gaming722