Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

run code on PROTEINS dataset error #7

@ColdenChan

Description

@ColdenChan

Hi, thanks for your code. But when I run python main.py --dataset PROTEINS, there is an error as follows:

Traceback (most recent call last):
  File "main.py", line 99, in <module>
    test_acc,test_loss = test(model,test_loader)
  File "main.py", line 65, in test
    out = model(data)
  File "/home/colden/.conda/envs/tg/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/colden/SAGPool/networks.py", line 45, in forward
    x, edge_index, _, batch, _ = self.pool3(x, edge_index, None, batch)
  File "/home/colden/.conda/envs/tg/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/colden/SAGPool/layers.py", line 20, in forward
    perm = topk(score, self.ratio, batch)
  File "/home/colden/.conda/envs/tg/lib/python3.6/site-packages/torch_geometric/nn/pool/topk_pool.py", line 18, in topk
    num_nodes = scatter_add(batch.new_ones(x.size(0)), batch, dim=0)
IndexError: dimension specified as 0 but tensor has no dimensions```

Can you help me to fix the bug? Thanks very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions