Where is the dgl.nn.pytorch.GraphConv()?


#1

I just wanted to run the example gcn code in dgl-master/examples/pytorch/gcn/train.py
but there was an error:
ImportError: cannot import name ‘GraphConv’ from ‘dgl.nn.pytorch’ (/anaconda3/lib/python3.7/site-packages/dgl/nn/pytorch/init.py)
and I also tried the following code:
from dgl.nn.pytorch.conv import GraphConv
but it didn’t work, either.
What should I do??


#2

Hi, it seems that you need to install the latest version of dgl. I just tried installing dgl with conda and it works.


#3

Thank you!
And I am puzzled about how to update the dgl safely?
Can I use “conda --upgrade dgl?”


#4

Try conda update -c dglteam dgl, if this does not work, you can always uninstall the previous one and reinstall with conda install -c dglteam dgl.


#5

Thx! I have already updated the dgl and run the code:stuck_out_tongue_winking_eye: