Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import MessagePassing raise TypeError: metaclass conflict #8992

Closed
deardeer7 opened this issue Feb 29, 2024 · 2 comments · Fixed by #8999
Closed

Import MessagePassing raise TypeError: metaclass conflict #8992

deardeer7 opened this issue Feb 29, 2024 · 2 comments · Fixed by #8999
Labels

Comments

@deardeer7
Copy link

🐛 Describe the bug

Hello, I got a metaclass confit error:

from torch_geometric.nn import MessagePassing
 File "/home/cuda/anaconda3/envs/esm+/lib/python3.8/site-packages/torch_geometric/__init__.py", line 9, in <module>
   import torch_geometric.data
 File "/home/cuda/anaconda3/envs/esm+/lib/python3.8/site-packages/torch_geometric/data/__init__.py", line 7, in <module>
   from .batch import Batch
 File "/home/cuda/anaconda3/envs/esm+/lib/python3.8/site-packages/torch_geometric/data/batch.py", line 12, in <module>
   from torch_geometric.data.dataset import IndexType
 File "/home/cuda/anaconda3/envs/esm+/lib/python3.8/site-packages/torch_geometric/data/dataset.py", line 30, in <module>
   class Dataset(torch.utils.data.Dataset, ABC):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

I find same issue here in pytorch issues, but still not clear how to solve, please help check.

Thanks in advance.

Versions

python 3.8.18
[pip3] numpy==1.24.3
[pip3] torch==1.12.1
[pip3] torch-cluster==1.6.3
[pip3] torch_geometric==2.5.0
[pip3] torch-scatter==2.1.2
[pip3] torchaudio==0.12.1
[pip3] torchdrug==0.2.1
[pip3] torchvision==0.13.1
[conda] blas 1.0 mkl defaults
[conda] cudatoolkit 11.6.0 hecad31d_10 conda-forge
[conda] ffmpeg 4.3 hf484d3e_0 pytorch
[conda] mkl 2021.4.0 h06a4308_640 defaults
[conda] mkl-service 2.4.0 py38h95df7f1_0 conda-forge
[conda] mkl_fft 1.3.1 py38h8666266_1 conda-forge
[conda] mkl_random 1.2.2 py38h1abd341_0 conda-forge
[conda] numpy 1.24.3 py38h14f4228_0 defaults
[conda] numpy-base 1.24.3 py38h31eccc5_0 defaults
[conda] pyg 2.5.0 py38_torch_1.12.0_cu116 pyg
[conda] pytorch 1.12.1 py3.8_cuda11.6_cudnn8.3.2_0 pytorch
[conda] pytorch-mutex 1.0 cuda pytorch
[conda] torch-cluster 1.6.3 pypi_0 pypi
[conda] torch-scatter 2.1.2 pypi_0 pypi
[conda] torchaudio 0.12.1 py38_cu116 pytorch
[conda] torchdrug 0.2.1 pypi_0 pypi
[conda] torchvision 0.13.1 py38_cu116 pytorch

@deardeer7 deardeer7 added the bug label Feb 29, 2024
@deardeer7
Copy link
Author

deardeer7 commented Mar 1, 2024

I delete all ABC class reported in error. It seems worked, but I don't konw why.

class Dataset(torch.utils.data.Dataset, ABC) -> class Dataset(torch.utils.data.Dataset)

@rusty1s
Copy link
Member

rusty1s commented Mar 1, 2024

Thanks. I don't have strong preference to keep the ABC, so I made #8999 to remove it.

rusty1s added a commit that referenced this issue Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants