我正在尝试从torch_geometric.nn库运行Node2Vec。作为参考,我下面是this示例
在运行train()函数时,我不断得到TypeError: tuple indices must be integers or slices, not tuple
我正在使用torch version 1.6.0
和CUDA 10.1
以及torch-scatter
、torch-sparse
、torch-cluster
、torch-spline-conv
和torch-geometric
的最新版本
以下是详细的错误:
Part 1 of the Error
Part 2 of the Error
谢谢你的帮助
Tags:
错误是由于
torch.ops.torch_cluster.random_walk
返回的是元组而不是数组/张量。我通过用这些函数替换torch_geometric.nn.Node2Vec
中的函数pos_sample
和neg_sample
修复了它请参阅PyTorch Node2Vecdocumentation
相关问题 更多 >
编程相关推荐