DGLError: Cannot update column of scheme Scheme(shape=(16,), dtype=torch.float32) using feature of scheme Scheme(shape=(2,), dtype=torch.float32)

I’m reproducing this paper and come across this bug.
This could have been resulted from this line of code:
self.gcn1 = GCN(2, 16, t.tanh)
which initialize a Graph Convolutional Networks with input_features=2, out_features=16 and activation=tanh. Any debugging would be acknowleged.

This looks like the bug fixed in this PR. Can you try installing the nightly built version or installing from source and see if the issue still exists?

1 Like

Dear Mufei Li,
Since I’m unfamilar with both kinds of installations (i.e. using Git and C compiler), I have tried your replacement first and the issue disappears. However, another bug exists:
AttributeError: 'NoneType' object has no attribute 'shape'
It stems from one line of your code in the new GCN module:
g.ndata['h'] = feature
while the forward function is being called upon:
mu = self.gcn2(g, x)
Thanks for your reply.
Regards.
Post Script:

  1. Your diagnosis seems to be right, since the last bug also came from the line:
    g.apply_nodes(func=self.apply_mod)
  2. I have tried both installing the latest nightly build version using pip:
    pip install --pre dgl
    and installing from source but the issue still exists. (Nothing changes for the former case, actually.)

AttributeError: ‘NoneType’ object has no attribute ‘shape’
It stems from one line of your code in the new GCN module:
g.ndata['h'] = feature

This basically means that somehow the feature is None rather than a tensor.

  1. I have tried both installing the latest nightly build version using pip:
    pip install --pre dgl
    and installing from source but the issue still exists. (Nothing changes for the former case, actually.)

There is a chance that you have multiple versions of DGL installed. Can you try uninstalling all versions of DGL and then installing the nightly built version again? You can uninstall DGL by executing pip uninstall dgl, potentially multiple times, until you cannot import dgl.

1 Like

The problem still persists. There’s no difference between the nightly build version and the regular one, even though the DGL version has been upgraded to 0.5.2 from 0.5.1 (as far as I remember).

  1. What’s the OS you are using?
  2. 0.5.2 is different from the nightly built version. The latter one includes fixes made in the master branch after 0.5.2.
  3. How can I reproduce the issue? Did you make any modifications to the code here? How did you run the code?
  1. I’m using Windows 7.

  2. How can I install that latter version?

  3. Follow this and that reading, this installation and run the code. No, I haven’t made any changes to the code yet. I run it on Spyder/Anaconda.

  1. I think for windows you need to git clone the repo and then follow the instructions here.
  2. I tried python main.py using the version in the master branch, which seems to be working well.
1 Like