pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.49k stars 3.69k forks source link

ModuleNotFoundError: No module named 'class_resolver' #5035

Open ewroginek opened 2 years ago

ewroginek commented 2 years ago

šŸ› Describe the bug

In the examples folder, running _dgcnnclassification.py and/or _pointnet2classification.py produces the following error:

Traceback (most recent call last):
  File "~/pytorch_geometric/examples/pointnet2_classification.py", line 98, in <module>
    model = Net().to(device)
  File "~/pytorch_geometric/examples/pointnet2_classification.py", line 48, in __init__
    self.sa1_module = SAModule(0.5, 0.2, MLP([3, 64, 64, 128]))
  File "~/.conda/envs/MCB/lib/python3.10/site-packages/torch_geometric/nn/models/mlp.py", line 83, in __init__
    from class_resolver.contrib.torch import activation_resolver
ModuleNotFoundError: No module named 'class_resolver'

I think this might be a new bug that emerged recently since the last few weeks

Environment

rusty1s commented 2 years ago

The class-resolver is an optional dependency in 2.0.4 (and dropped completely in master right now). You can fix the issue by just running pip install class-resolver.