divelab / DIG

A library for graph deep learning research
https://diveintographs.readthedocs.io/
GNU General Public License v3.0
1.86k stars 281 forks source link

Can't import SphereNet (version error) #156

Closed sentinel8b closed 2 years ago

sentinel8b commented 2 years ago

Hi, I've recently read your paper about SphereNet and it was impressive. But I had a error when I tried import SphereNet with code below

from dig.threedgraph.method import SphereNet

error message was like this.

No module named 'torch_geometric.nn.acts'

I think it's because DIG library is not compatible with PyG = 2.1.0

Could you manage your project to support PyG = 2.1.0? or let me know how to handle those error.

sentinel8b commented 2 years ago

my torch version is 1.12.1+cu113 and torch_geometric version is 2.1.0

Mahmood-Kazemi commented 2 years ago

Hi, I also faced this error yesterday! I think the best solution is to change a particular single line in these files: dimenetpp.py - spherenet.py - comenet.py - pronet.py

change from torch_geometric.nn.acts import swish to from torch_geometric.nn.resolver import swish

I'll create a pull request for it.

sentinel8b commented 2 years ago

As @Mahmood-Kazemi reported, change

from torch_geometric.nn.acts import swish

to

from torch_geometric.nn.resolver import swish

fixed my problem.

limei0307 commented 1 year ago

Thanks a lot for all your questions and contributions to keeping our package up to date! I also updated the code to define the swish function directly in the model file as shown here to make our method compatible with more versions of PyG.

DIG team