Open faizan1234567 opened 2 years ago
Can you define via HANConv(in_channels, hidden_channels, heads=heads, …)
? This should fix the issue.
Sure let me check
Now it gives me this error.
I am using this example from PyTorch geometric examples.
Moreover, I am running my code on Google Colab.
please see this as well.
Ok issue resolved. I used HANConv(in_channels, hidden_channels, heads = heads, dropout = 0.6, metadat = data.metadata())... this solved the issue. Thank you for your support
🐛 Describe the bug
I defined HAN class for heterogeneous graph learning on the IMDB dataset. However, when I create metadata and pass it on to the HAN class it gives me " init() got multiple values for argument 'metadata' ". The code is shown here.
path = osp.join(osp.dirname(osp.realpath('file')), '../../data/IMDB')
metapaths = [[('movie', 'actor'), ('actor', 'movie')], [('movie', 'director'), ('director', 'movie')]] transform = T.AddMetaPaths(metapaths= metapaths, drop_orig_edges= True, drop_unconnected_nodes= True) dataset = IMDB(path, transform= transform) data = dataset[0]
class HAN(nn.Module): def init(self, in_channels: Union[int, Dict[str, int]], out_channels: int, hidden_channels = 128, heads=8): super().init()
def forward(self, x_dict, edge_index_dict): x = self.HanConv(x_dict, edge_index_dict) x = self.lin(x['movie']) return x model = HAN(in_channels= -1, out_channels= 3) print(model)
please help me fix this bug.
Environment
conda
,pip
, source):torch-scatter
):